cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Unbihexium
Level: Powered On

generate consecutive number with lookup function

Hello guys

 

I'm creating a new App, which should submit a filled form to a befor created list in SharePoint.
I would like to implement the following:

As soon as the specific page is called up,
a sequential number should be automatically generated in the field "Auftrag ID"  (see screenshot "pic1")
which was previously determined in a SharePoint list. --> for example: last ID in "Auftrag ID" (in SharePoint) is 000251 --> next have to be 000252. 

Can someone help me with that? 

 

I've tried something like this in the "default" section
LookUp('Erfassung und Freigabe neuer Artikel 2';'Auftrag ID' = Number(Max('Erfassung und Freigabe neuer Artikel 2';'Auftrag ID'))

 

regards

4 ACCEPTED SOLUTIONS

Accepted Solutions
Dual Super User
Dual Super User

Re: generate consecutive number with lookup function

@Unbihexium 

 

Can you try to use:
Value(First(Sort('Erfassung und Freigabe neuer Artikel 2';'Auftrag ID';Descending)).'Auftrag ID') +1
 
From your formula mentioned in original post, I think ";" is accepted in your case, instead of a comma.

View solution in original post

Community Support Team
Community Support Team

Re: generate consecutive number with lookup function

Hi @Unbihexium ,

Do you want "Auftrag ID" field to be automatically filled in data in edit form?

I've made a similar test for your reference:

Set the "Auftrag ID" field's cintrol's Default:

Max('Erfassung und Freigabe neuer Artikel 2','Auftrag ID')+1

If you use ";" as separator, try:

Max('Erfassung und Freigabe neuer Artikel 2';'Auftrag ID')+1

Then, the textinput will be automatically filled in data that is larger than the existing max number.

664.png

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Dual Super User
Dual Super User

Re: generate consecutive number with lookup function

@Unbihexium 

 

you can try to use the below expression:
Text(Value(First(Sort('Erfassung und Freigabe neuer Artikel 2';'Auftrag ID';Descending)).'Auftrag ID') +1,"[$-en-US]000000")
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
 

View solution in original post

Dual Super User
Dual Super User

Re: generate consecutive number with lookup function

@Unbihexium

 

The warning that you are getting for delegation is because the Max function won't get the correct results in cases where the records are more than 500/2000. This depends on your application settings for Data row Delegation limit. 
 
If you will use this:
Text(Value(First(Sort('Erfassung und Freigabe neuer Artikel 2';'Auftrag ID';Descending)).'Auftrag ID') +1,"[$-en-US]000000")
 
All the functions here are delegable so the warning won't come and you will get the correct result irrespective of the number of records in your data source.
 
Hope this Helps!

View solution in original post

9 REPLIES 9
Dual Super User
Dual Super User

Re: generate consecutive number with lookup function

Hi @Unbihexium 

 

You can try using the below expression to get the required result:
 
Value(First(Sort('Erfassung und Freigabe neuer Artikel 2','Auftrag ID',Descending)).'Auftrag ID') +1
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Unbihexium
Level: Powered On

Re: generate consecutive number with lookup function

Hi yashag2255

Thank you verry much for the quick reply.

I've tried your code but I got the following error

text or number expected. At this point in the formula text or a number is expected

regards

Dual Super User
Dual Super User

Re: generate consecutive number with lookup function

@Unbihexium 

 

Can you try to use:
Value(First(Sort('Erfassung und Freigabe neuer Artikel 2';'Auftrag ID';Descending)).'Auftrag ID') +1
 
From your formula mentioned in original post, I think ";" is accepted in your case, instead of a comma.

View solution in original post

Community Support Team
Community Support Team

Re: generate consecutive number with lookup function

Hi @Unbihexium ,

Do you want "Auftrag ID" field to be automatically filled in data in edit form?

I've made a similar test for your reference:

Set the "Auftrag ID" field's cintrol's Default:

Max('Erfassung und Freigabe neuer Artikel 2','Auftrag ID')+1

If you use ";" as separator, try:

Max('Erfassung und Freigabe neuer Artikel 2';'Auftrag ID')+1

Then, the textinput will be automatically filled in data that is larger than the existing max number.

664.png

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Unbihexium
Level: Powered On

Re: generate consecutive number with lookup function

Hi yashag2255

 

This works perfect! Thank you very much!!

Is it somehow possible to get the "0" befor the actual number like "000001" ?

Best regards

Dual Super User
Dual Super User

Re: generate consecutive number with lookup function

@Unbihexium 

 

you can try to use the below expression:
Text(Value(First(Sort('Erfassung und Freigabe neuer Artikel 2';'Auftrag ID';Descending)).'Auftrag ID') +1,"[$-en-US]000000")
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
 

View solution in original post

Unbihexium
Level: Powered On

Re: generate consecutive number with lookup function

Good morning Phoebe Liu

Thank you very much for your reply! 

This seams to work as well, but with a warning
"Warning about delegation. The highlighted part of this formula may not work properly for large datasets. The Max operation is not supported by this connector."

But I got the number.

Best regards


Dual Super User
Dual Super User

Re: generate consecutive number with lookup function

@Unbihexium

 

The warning that you are getting for delegation is because the Max function won't get the correct results in cases where the records are more than 500/2000. This depends on your application settings for Data row Delegation limit. 
 
If you will use this:
Text(Value(First(Sort('Erfassung und Freigabe neuer Artikel 2';'Auftrag ID';Descending)).'Auftrag ID') +1,"[$-en-US]000000")
 
All the functions here are delegable so the warning won't come and you will get the correct result irrespective of the number of records in your data source.
 
Hope this Helps!

View solution in original post

Highlighted
Unbihexium
Level: Powered On

Re: generate consecutive number with lookup function

Yashag225

Awesome! Exactly what I needed! 
Needed to change the comma with a semicolon between +1   ;   "[$-en-US]000000")

Thank you very much!!
Best regards

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,482)