cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

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
Highlighted
Dual Super User III
Dual Super User III

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

Highlighted
Community Support
Community Support

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

Highlighted
Dual Super User III
Dual Super User III

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

Highlighted
Dual Super User III
Dual Super User III

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
Highlighted
Dual Super User III
Dual Super User III

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!
Highlighted
Helper III
Helper III

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

Highlighted
Dual Super User III
Dual Super User III

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

Highlighted
Community Support
Community Support

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

Highlighted
Helper III
Helper III

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

Highlighted
Dual Super User III
Dual Super User III

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

Highlighted
Helper III
Helper III

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


Highlighted
Dual Super User III
Dual Super User III

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
Helper III
Helper III

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
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,503)