Hi I am trying to create 6 digit unique autoincrement Process Id starting from 000001 to.... In power canvas app on create button and save it to SharePoint list. On create button it should check sharepoint last ID and auto increment it by 1 and show it on form and then update new on create button of form. But unfortunately it is showing 1 instead of 0000001 ..........
Can anybody plz help me to resolve this????
Thanks in advance
Solved! Go to Solution.
We need to wrap First(Sort(... in Text( to convert it to a text value that can be concatenated. Try this
With(
{
newID: Right(
Concatenate(
"000000",
Text(
First(
Sort(
'SRD data',
'Process ID',
Descending
)
).'Process ID' + 1,
"######"
)
),
6
)
},
If(
IsBlank(Parent.Default),
newID,
Parent.Default
)
)
Or get rid of the Concatenate and just use
With(
{
newID: Right(
"000000" & First(
Sort(
'SRD data','Process ID',Descending
)
).'Process ID' + 1,
6
)
},
If(
IsBlank(Parent.Default),
newID,
Parent.Default
)
)
If the form is New, Parent.Default will be blank. This formula can be used for the Default value of a textbox control in the 'Process ID' card or as the Update property of the card. I would either hide this card or make it disabled so users can't change it.
Right(Concatenate("0000000", First(Sort(SPlist,ID,Descending)).ID+1),6)
Hi @Drrickryp Thanks for Replying.
I tried this but unfortunately it is giving me some error. It would be great if you could help me to solve this.
If(Form1.Mode=FormMode.New,Right(Concatenate("000000",First(Sort('SRD data','Process ID',Descending)).'Process ID'+1),6))
Getting error on Concatenate and First in the code.
Thanks in advance
We need to wrap First(Sort(... in Text( to convert it to a text value that can be concatenated. Try this
With(
{
newID: Right(
Concatenate(
"000000",
Text(
First(
Sort(
'SRD data',
'Process ID',
Descending
)
).'Process ID' + 1,
"######"
)
),
6
)
},
If(
IsBlank(Parent.Default),
newID,
Parent.Default
)
)
Or get rid of the Concatenate and just use
With(
{
newID: Right(
"000000" & First(
Sort(
'SRD data','Process ID',Descending
)
).'Process ID' + 1,
6
)
},
If(
IsBlank(Parent.Default),
newID,
Parent.Default
)
)
If the form is New, Parent.Default will be blank. This formula can be used for the Default value of a textbox control in the 'Process ID' card or as the Update property of the card. I would either hide this card or make it disabled so users can't change it.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
185 | |
53 | |
41 | |
37 | |
31 |
User | Count |
---|---|
245 | |
75 | |
71 | |
69 | |
65 |