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 Platform Community / Forums / Power Apps / Generating a Unique Na...
Power Apps
Answered

Generating a Unique Name for a Form field with a convention

(0) ShareShare
ReportReport
Posted on by 30

Hi Team,

 

I wanted to ask for your support in finding a way to generate a naming conventions for a PowerApp Form. 

I need each form to have a unique name that follows a convention and that is consecutive for example there is a field in the form that is called "Request Number". I would need this field to retun back a automatically generate unique code that follows this format: PACFORM-######, in which the number (#) is a consecutive number (i.e. PAC-000001 than the following form submitted will have PACFORM-000002) for each of the forms submitted. 

 

Hope to hear back.

 

-Daniel  

Categories:
I have the same question (0)
  • Verified answer
    RezaDorrani Profile Picture
    12,145 on at

    Hi @DanMuriel 

     

    You could use the SharePoint ID column as a reference

     

    Once you submit/post form data to sharepoint

    you can use the onsuccess property to fetch the ID value of the last submitted item

     

    Form.LastSubmit.ID - you can get this in the onsuccess property of your form control

     

    and then patch the same item in the onsuccess property

     

    PACFORM-ID

    and so on

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • DanMuriel Profile Picture
    30 on at

    Hi @RezaDorrani 

     

    Thank you for your response, I was trying create the patch on the OnSuccess Field on form but have an problem. 

     

    This is the what I am typing in the field: 

     

    Patch(PAC_List, Defaults(PAC_List),{Title: "PAC-Form-" & PAC_FORM_MAIN.LastSubmit.ID})

     

    In the submit button I have a general SubmitForm(PAC_FORM_MAIN)  I have also tried putting the Patch in the submit button but the lastsubmit.ID is not populating in the field. 


    @RezaDorrani wrote:

    Hi @DanMuriel 

     

    You could use the SharePoint ID column as a reference

     

    Once you submit/post form data to sharepoint

    you can use the onsuccess property to fetch the ID value of the last submitted item

     

    Form.LastSubmit.ID - you can get this in the onsuccess property of your form control

     

    and then patch the same item in the onsuccess property

     

    PACFORM-ID

    and so on

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly



    @RezaDorrani wrote:

    Hi @DanMuriel 

     

    You could use the SharePoint ID column as a reference

     

    Once you submit/post form data to sharepoint

    you can use the onsuccess property to fetch the ID value of the last submitted item

     

    Form.LastSubmit.ID - you can get this in the onsuccess property of your form control

     

    and then patch the same item in the onsuccess property

     

    PACFORM-ID

    and so on

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly



    Any suggestions? 

     

    But when I test it out I get an error message 

  • RezaDorrani Profile Picture
    12,145 on at

    Hi @DanMuriel 

     

    OnSuccess property Patch function should look like

     

    Patch(PAC_List, PAC_FORM_MAIN.LastSubmit,{Title: "PAC-Form-" & PAC_FORM_MAIN.LastSubmit.ID})

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

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
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard