web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Get last id submitted ...
Power Apps
Unanswered

Get last id submitted in dataverse table

(0) ShareShare
ReportReport
Posted on by

hello ,

Usually, I use sharepoint with power apps. To get the id of the last records that I add I use Form1.LastSubmit.ID, but in Dataverse return error with the same code, how do this?

Thanks

I have the same question (0)
  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @siforibo ,

     

    In dataverse Table, your table name will usually be unique identifier containing GUID.

    So, let's say for example your Table name is Account then its primaryID field name is accountid 

     

    Try to find the fieldname that is similar to your Table Name (singular usually) is your ID value

    Form1.LastSubmit.<FieldNameAsTableName>

     

    Hope this helps

     

  • siforibo Profile Picture
    on at

    @Ethan_R , 
    i do it :
    Set(
    idreclamation;
    Form1.LastSubmit.'id-reclamation'
    )

    but it retun error "incompatible type. we cannot evaluate your form, Cal the context variable type is not compatible with value types elsewhere in your application"

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @siforibo ,

     

    Note: If you reload or launch app then the last submitted won't work, if you need last record been created then you have to make different query filter.

     

    Now, coming on Last submitted value

    Can you try the following please, I hope you get some data 

    Step 1: Insert a Data Table control on your Screen.

    Step 2: In the Items property, simply add "Form1.LastSubmit" and wait to see your last submitted data.

    Step 3: You can add more fields from the right panel property (in Fields) and based on Column Name, you can use correct way of getting value as Form1.LastSubmit.FieldName (If any conversion in type needed is later part)

     

    Hope this helps

  • TKSHEP Profile Picture
    212 on at
    Where you by chance able to get this to work? I am trying to figure out the same issue. Thank you so much for your help.
  • siforibo Profile Picture
    on at

    I don't know where is the problème. I have ignored the problème with Manuel generation of code (when the user connect, I get the last number was added by this user and I wrote it with his id ex: iduser-Ascending number) and submit the record with this id.
    I do some application with Dataverse it work normally, so I don't know really where is the problème

  • citdevpros Profile Picture
    61 on at

    Hi @siforibo ,

    You should just be able to use the name of the DataVerse table's Primary Column

    Set(idreclamation, Form1.LastSubmit.primaryColumnName)

    I notice in your above comment you have a semi-colon ";" in your Set statement, change it to a comma ",".

     

    For testing, you can get rid of the Set statement. Just add a label to your app and for the text property, start typing 

    Form1.LastSubmit. 

    This will obviously only work after you have performed a SubmitForm(Form1)

    Once you add that period, the formula bar should suggest to you all of the field names that are available to you, you can try them out until you get the one you want. Then you know the LastSubmit is working, and you can paste that into your Set statement.

     

    The "variable type is not compatible with value types elsewhere in your application" just means that here you are trying to assign the variable with e.g. an integer but elsewhere you have assigned it e.g. a record. But don't worry about that too much until you have finished getting rid of the first problem.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard