Hello Experts,
I want to setup unique ID format in my Activity ID filed , This way
Username-BG-Sequence Number, the last sequence number will increase only.
I tried using this formula on default property of field but its not working. App stores data in SP list BG Activity Recorder , format formation is happening but it not increasing the last number.
For Example last Activity ID in SP list was BEE Power BI-BG-950 so next should be BEE Power BI-BG-951 but its again picking BEE Power BI-BG-950 PLease advise
If(Frm_02.Mode=FormMode.Edit,
User().FullName&"-BG-"&First(Sort(AddColumns([@'BG Activity Recorder'],"NewCol",
Trim(Substitute('Activity ID',"BG-",""))*1),NewCol, Descending)).NewCol+1,Parent.Default)
Solved! Go to Solution.
Hi @SachinG31 ,
Please try this formula:
If(Frm_02.Mode=FormMode.Edit,User().FullName&"-BG-"&First(Sort(AddColumns([@'BG Activity Recorder'],"NewCol",Value(Trim(Mid('Activity ID',Find("BG-",'Activity ID')+3)))),NewCol,Descending)).NewCol+1,Parent.Default)
Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.
Hello @v-xiaochen-msft ,
thanks for your time and support , i am using below formula and it is working good as per my requirement.
If(Frm_02.Mode=FormMode.Edit,Dropdown13.SelectedText.Result&"-BG-"&First(Sort(AddColumns([@'BG Activity Recorder'],"NewCol",
Trim(Substitute('Activity ID',Left('Activity ID',Find("-",'Activity ID',Find("-",'Activity ID')+1)),""))*1),NewCol, Descending)).NewCol+1,Parent.Default)
Hi @SachinG31 ,
Could you tell me:
When do you want to get and use ’Activity ID+1‘ ? (Editform or Newform?)
What control do you use to display the Activity ID? (Lable or Textinput or anything else)?
When the displaymode of the form is edit, does it still fail to display the correct activity ID?
Best Regards,
Wearsky
Hello @v-xiaochen-msft , Thanks for your response. Please find my comments below
When do you want to get and use ’Activity ID+1‘ ? (Editform or Newform?), when form is in Edit mode
What control do you use to display the Activity ID? (Lable or Textinput or anything else)? , Its Text in put data card
When the displaymode of the form is edit, does it still fail to display the correct activity ID? Yes.
Actually i tried this formula below.
If(Frm_02.Mode=FormMode.Edit,
User().FullName&"-BG-"&First(Sort(AddColumns([@'BG Activity Recorder'],"NewCol",
Trim(Substitute('Activity ID',User().FullName&"-BG-",""))*1),NewCol, Descending)).NewCol+1,Parent.Default)
and now it is increasing the only last number on behalf of last available activity ID in SP list , but only for the user1. for User2 it is starting from 1 again.
For Example when logged in by user1 and last inserted Activity ID in SP list is User1-BG-950, so it takes User1-BG-951 and next 1 User1-BG-952, which is correct, but when user2 logged in it takes ActivityID as User2-BG-1.
My App is multi user and more than 30 users uses it.
i want to continue by last inserted Activity ID in SP list +1 , regardless which users logged in. like for User2, i was expecting User2-BG-953, if last inserted ID by any user in SP list is UserN-BG-952
Hi @SachinG31 ,
Please try this formula:
If(Frm_02.Mode=FormMode.Edit,User().FullName&"-BG-"&First(Sort(AddColumns([@'BG Activity Recorder'],"NewCol",Value(Trim(Mid('Activity ID',Find("BG-",'Activity ID')+3)))),NewCol,Descending)).NewCol+1,Parent.Default)
Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.
Hello @v-xiaochen-msft ,
thanks for your time and support , i am using below formula and it is working good as per my requirement.
If(Frm_02.Mode=FormMode.Edit,Dropdown13.SelectedText.Result&"-BG-"&First(Sort(AddColumns([@'BG Activity Recorder'],"NewCol",
Trim(Substitute('Activity ID',Left('Activity ID',Find("-",'Activity ID',Find("-",'Activity ID')+1)),""))*1),NewCol, Descending)).NewCol+1,Parent.Default)
User | Count |
---|---|
257 | |
110 | |
97 | |
52 | |
39 |