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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Answered

Using ID in a form

(0) ShareShare
ReportReport
Posted on by 276
Hi, hope someone can help,

In order to make all my records unique I have adopted a job reference which incorporates the ID of the record as part of it.
I have a field in my form for job reference and it creates a value which consists of the record ID reference / the property address / our error code

What seems to be happening when I save the form is that the job refernace which should look something like 34/254/E5 is coming up as /254/E5 so the field is saving the value of the property address “245” and the error code “E5” but it seems to not be able to get the reference ID until after the record has been saved once using ‘SubmitForm’

Is this because the ID reference of the record isn’t issued until the form is saved?

Once the form is saved you can see the full reference in the files, but you have to press save again so that it writes it too the data source.

I have tried SubmitForm(formname);SubmitForm(Formname) but I just get an error.

Is there a way to update the record, before the form is submitted so that the job reference is written to the data source correctly first time?

Sorry if this doesn’t make clear sense, found it hard to explain what I’m trying to achieve!

Thanks
Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @d3ell 

     

    Is this because the ID reference of the record isn’t issued until the form is saved?

    Yes, that is exactly why.  An ID is not issued until the record is created.

    What you can do easily is just adjust your submit to something like the following:

     

    SubmitForm(FormName); Patch(yourDataSource, FormName.LastSubmit, {jobReferenceField: FormName.LastSubmit.ID & FormName.LastSubmit.jobReferenceField})

    This will prepend the last submitted jobReferenceField value ("/254/E5" in your example) with the ID ("34" in your example.  Result is what is desired.

     

    Give it a shot and I hope it helps.

     

     

     

  • d3ell Profile Picture
    276 on at

    Thank you that has worked !

     

    Much appreciated! 🙂

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard