Hi All,
I am in the process of developing poserapps customized form for sharepoint list.
the need is in sharepoint list whenever i click the + symbol below pasutijuma Nr, i was expecting it create an auto generated order no starting from AR0001,
then when i open new task on list and press the +button it should generate AR0002 and so on.
but at the moment donot know how to do it.
Solved! Go to Solution.
Hi @Vinoth1_ :
Please try this solution:
Find the record with the highest order number in the data source, get its number and +1
1\Set the "+"'s OnSetect proeprty to:
Set(
Var, /*Var is my custom variable*/
"AR" & Text(
Value(
Right(
First(
Sort(
Filter(
YourDateSource,
StartsWith(Title,"AR") /*Title is the name of the field used to store the order number, yours may be Pas...*/
),/*Get all records with numbers starting with AR*/
Value(
Right(
Title,
4
)
),/*The root intercepts the last four digits of the order number and formats it as a number*/
Descending/*Sort according to the numerical value of the last four digits of the order number*/
)
).Title,
4
)
) + 1,/*Get the largest order number, add his value +1*/
"[$-en]0000"
)
);
Reset(TextInput1)/*Reset the textinput control*/
2\Set the TextInput1's Default property to:
Var
Best Regards,
Bof
any help with formular are highly appreciated.
Hi @Vinoth1_ :
Please try this solution:
Find the record with the highest order number in the data source, get its number and +1
1\Set the "+"'s OnSetect proeprty to:
Set(
Var, /*Var is my custom variable*/
"AR" & Text(
Value(
Right(
First(
Sort(
Filter(
YourDateSource,
StartsWith(Title,"AR") /*Title is the name of the field used to store the order number, yours may be Pas...*/
),/*Get all records with numbers starting with AR*/
Value(
Right(
Title,
4
)
),/*The root intercepts the last four digits of the order number and formats it as a number*/
Descending/*Sort according to the numerical value of the last four digits of the order number*/
)
).Title,
4
)
) + 1,/*Get the largest order number, add his value +1*/
"[$-en]0000"
)
);
Reset(TextInput1)/*Reset the textinput control*/
2\Set the TextInput1's Default property to:
Var
Best Regards,
Bof
Hi @v-bofeng-msft ,
Thanks for help, i appreciate.
i used this formula on property & used Var on text input
Set(
Var,
"AR" & Text(
Value(
Right(
First(
Sort(
Filter(
'Aluminium order',
StartsWith('Pasūtījuma Nr',"AR")
),
Value(
Right(
'Pasūtījuma Nr',
4
)
),
Descending
)
).'Pasūtījuma Nr',
4
)
) + 1,
"[$-en]0000"
)
);
Reset(DataCardValue12)
when i make a new item, the form already has this number before i press the + button
and when i make a new item next, it again has the same order no.
please can you tell me what went wrong here. what adjustment should i need to make.
Hi @Vinoth1_ :
The reason is that the value of the variable Var is not reset, it is retained until you add the record for the second time.
The solution is simple:
The key is to clear the value of the variable Var after submitting the record.
1\Set the SharePointIntegration's OnSave property to:
SubmitForm(SharePointForm1);Set(Var,"")
If you submit the record through a custom button, then you can put Set(Var,"") after the formula you submit the record.
2\Set the DateCardValue12's Default property to(This step is to increase the robustness of the app):
If(IsBlank(Parent.Default),Var)
Best Regards,
Bof
Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.
Did you miss the call?? Check out the Power Apps Community Call here!
User | Count |
---|---|
259 | |
206 | |
76 | |
38 | |
32 |
User | Count |
---|---|
344 | |
218 | |
117 | |
71 | |
54 |