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 / LastSubmit to create a...
Power Apps
Answered

LastSubmit to create a Custom ID and then show the Custom ID on the app

(0) ShareShare
ReportReport
Posted on by 143

I'm using the LastSubmit function to grab the ID (OnSuccess Property) and then using Patch Function to update SharePoint Column called TicketID.

TicketID created is for example CAT-000"ID"

All of the above steps are working, but I want to show the TicketID created to the user after they click on Submit Button

Problem is the LastSubmit + Patch functions take longer to run than code execution, so the TicketID field is blank (even though it is created on the backend)

I'm using this function to call the TicketID after the Patch Function

Set(varTicketID, "Formname", LastSubmit.TicketID)

 

I'm not able to get the TicketID show on the App

 

Thanks

 

 

Categories:
  • WarrenBelz Profile Picture
    156,940 Most Valuable Professional on at

    Hi @johnnykalsi ,

    What is the Patch code (in Text please) you are using and is this before or after the form submission. Also I assume you want CAT-IDNo to three characters (CAT-123 when the ID is 123)

  • johnnykalsi Profile Picture
    143 on at

    This is the Code I'm using OnSuccess Property

    With(
     {vLastSubmit: SharePointForm1.LastSubmit},
     Patch(
     DemoOfCustomID,
     vLastSubmit,
     {CustomID: $"CAT-00{vLastSubmit.ID}"}
     )
    );
    Set(varTicketID, SharePointForm1.LastSubmit.CustomID)

    The Custom ID gets created but doesnt show on the PowerApp

     

  • Verified answer
    WarrenBelz Profile Picture
    156,940 Most Valuable Professional on at

    Hi @johnnykalsi ,

    Why not simply create it first

    Set(
     varTicketID,
     "CAT-00" & Self.LastSubmit.ID
    );
    Patch(
     DemoOfCustomID,
     Self.LastSubmit,
     {CustomID: varTicketID}
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • johnnykalsi Profile Picture
    143 on at
    Self.LastSubmit.ID

    Great idea...I didn't know that it could be done like that...and with this I don't need any With Statement

    I'll try it out tomm and reply back

    Thank you

  • johnnykalsi Profile Picture
    143 on at

    it worked and its much simpler than what i had. I didn't know i could use the Self.LastSubmit, which makes it easier

    Thank you

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard