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 / Submit Form unique ID ...
Power Apps
Unanswered

Submit Form unique ID / number

(0) ShareShare
ReportReport
Posted on by 63

I have an Online Job Card which the employees complete for each job they do.
Each Job Card are completed on the Power App and the data is saved into Excel.
In Excel, each Job Card is saved on a one liner on the tab.
Each Job Card gets a unique Job Card no, which is the " ID _ Column" column on the Excel tab. The ID Column follows in numerical order and each line which is a new Job Card follows.
The If function works fine, except if the Form is Submitted at +- the same time.
At the start of using the Online Job Card there weren't any issues with the If function. But now with more and more people using it, it happens that people Submits around the same time and the unique number " ID _ Column " is duplicated.
Thus, the If function doesn't work if the Submit button is pushed at +- the same time.
Any suggestions on another check to build in, will be truly appreciated.
Is there perhaps a time-delay function which will work and can be included?
Any suggestions will be awesome.
Thank you!

 

If(
!IsBlank(LookUp(JobCardMetering,
ID_Column = DataCardValue_JobCardNo.Text
)
) &&
IsBlank(LookUp(JobCardMetering,
Job_Complete = Dropdown_Complete.SelectedText.Value
)
),
SubmitForm(EditForm1_Intro),
Notify(
"The process was started. And the Job Card no. was generated. Complete the process.",
NotificationType.Error
)
);
Refresh(JobCardMetering); 
SubmitForm(EditForm1_Intro)

 

 

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Mareliese 

    You can assign the ID in the OnSuccess property of your form by Patching it immediately when the record is created. 

    Patch(
     JobCardMetering,Editform1_Intro.LastSubmit,
     {ID:First(
     Sort(
     JobCardMetering, ID, Descending
     )
     ).ID+1
     }
    )

     

  • Mareliese Profile Picture
    63 on at

    Thank you. It worked except that the new ID Column unique number allocated to the 'double' ID number, started at 1000 and added +1 from 1000. I amended the Patch as per below which is working, it allocates the next number on the Excel column and saves it on the Excel. The next step is just to Refresh the Job Card No. / ID number on the second screen of the application. On the 2nd screen the old / incorrect ID Column number sticks / reflects again and then moving from the 2nd tot he 3rd screen, the incorrect ID Column number is saved back to Excel. Thanks for the help. 

    Spoiler (Highlight to read)
    Patch(JobCardMetering,EditForm1_Intro.LastSubmit,
    {ID_Column:Max(JobCardMetering,ID_Column)+1
    }
    );
    Patch(JobCardMetering,EditForm1_Intro.LastSubmit,{ID_Column:Max(JobCardMetering,ID_Column)+1});

     

  • Mareliese Profile Picture
    63 on at

    Apologies for inserting it as a spoiler. Wrong button 😊. What exactly is a Spoiler? Thank you 😁

    Patch(JobCardMetering,EditForm1_Intro.LastSubmit,
    {ID_Column:Max(JobCardMetering,ID_Column)+1
    }
    );
  • Mareliese Profile Picture
    63 on at

    Dear Drrickryp, any more thoughts will be awesome. 

    As per your patch, the new ID Column's unique number starts at 1000 and ads 1. It doesn't not take the last listed number and ads 1. 

    My patch ads 1 to the ID Column each and every time, not only when it is a double ID Column number. 

    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 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard