Notifications
Announcements
Hello, I am working on powerapp. I want to generate a unique ID upon clicking on sending order button. I am trying to explore using regex but I have no idea how to implement the code. Can someone teach me how to use regex (regular expression) in powerapp to generate a unique ID?
my current code for ID
Hi @Anonymous ,
You might consider using the GUID function to generate unique IDs efficiently.
Text(GUID())
Best Regards,
Wearsky
Hi @v-xiaochen-msft
I tried using GUID function but it doesnt work.
I want to create an unique ID with prefix "ABC_" so the sharepoint list data will have ABC_1432 as an example.
May I know how to do so?
Please try:
With( {OrderID:First(Sort(OrderList,OrderID,Descending)).Value}, "ABC_"&Text(Value(Last(Split(OrderID,"_")).Result)+1,"0000"))
I have modified the code abit.
The error I received after clicking on submit button is The value 'PSA_329378073' cannot be converted to number.
Submit button
May I know how to resolve this? thank you
The point is that the string "PSA_329378073" can not be converted to number...
It's by design.
Okay I understand. May I know if there is any way for me to auto generate an ID that contain "PSA_329378073" in powerapps. I need use as reference ID.
Please replace
Value(OrderID)
with
With( {TheOrderID:First(Sort(OrderList,OrderID,Descending)).Value}, "PSA_"&Text(Value(Last(Split(TheOrderID,"_")).Result)+1,"00"))
Hii, if I replace Value(OrderID) with the following you mentioned, I will have error.
may I know if is it possible to store lbl_Orderid into a variable then use OrderID = newvar in my submit button
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.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 380 Most Valuable Professional
Kalathiya 340
MS.Ragavendar 333 Super User 2025 Season 2