Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
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

Categories:
  • citdevpros Profile Picture
    61 on at
    Re: Get last id submitted in dataverse table

    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.

  • siforibo Profile Picture
    on at
    Re: Get last id submitted in dataverse table

    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

  • TKSHEP Profile Picture
    209 on at
    Re: Get last id submitted in dataverse table
    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.
  • Ethan_009 Profile Picture
    4,838 Super User 2025 Season 1 on at
    Re: Get last id submitted in dataverse table

    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

  • siforibo Profile Picture
    on at
    Re: Get last id submitted in dataverse table

    @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 Super User 2025 Season 1 on at
    Re: Get last id submitted in dataverse table

    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

     

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Microsoft Dataverse

#1
mmbr1606 Profile Picture

mmbr1606 22 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 17

#3
ankit_singhal Profile Picture

ankit_singhal 11 Super User 2025 Season 1

Overall leaderboard

Featured topics