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

Auto-Increment form SP Online List - Works for awhile and then doesn't increment

If(frmSPEstimateList.Mode = FormMode.New, Last(Estimates).Title + 1,Parent.Default)

 

I have the above code setup on a Text Input field inside a PowerApp SP Form to initialize an auto increment numbering system for new submissions. I have the text input field "Display Mode" set to "View" so it can't be changed. This code works great but for some odd reason, for a reason unknown, it will stop auto-incrementing to the next sequential value. 

 

To fix this issue, I have been able to quick edit the next sequential number but since this latest mishap with the PowerApp I have been unsuccessful in correcting the issue. 

I was hoping someone was having a similar issue or someone can inform me how to fix this issue from happening again.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Auto-Increment form SP Online List - Works for awhile and then doesn't increment

Hi @llacefield,

Could you please share a bit more about the Estimates that you mentioned within your SP list? Is it your SP list?

Does the Title represents the Bid Number column in your SP list? In other words, do you rename the Title column into Bid Number?

If you renamed the Title column into Bid Number within your SP list, I think there is something wrong with the formula that you provided. The Last(Estimates).Title formula would return a text value rather than a Number value.

Please modify your formula as below:

 

If(
frmSPEstimateList.Mode = FormMode.New,
Value(Last(Estimates).Title) + 1,
Parent.Default
)

Note: I assue that Estimates represents your SP list.

 

 

If the Bid Number is a custom Number type column in your SP list, I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:3.JPG

Please check the following GIF screenshot for more details:Test1.gif

Please also take a try with the following formula:

If(
   frmSPEstimateList.Mode = FormMode.New, 
   Value(Last(SortByColumns(Estimates,"ID",Ascending)).Title) + 1,
   Parent.Default
)

then check if the issue is solved.

If the issue still exists, please take a try to delete/remove the custom form from your SP list, then re-create a new custom form using PowerApps, check if the issue is solved.

More details about deleting custom form from SP list, please check the following article:

Delete custom form

 

Best regards,

Kris

Community Support Team _ Kris Dai
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

7 REPLIES 7
Community Support Team
Community Support Team

Re: Auto-Increment form SP Online List - Works for awhile and then doesn't increment

Hi @llacefield,

Could you please share a bit more about the Estimates that you mentioned within your SP list? Is it your SP list?

Does the Title represents the Bid Number column in your SP list? In other words, do you rename the Title column into Bid Number?

If you renamed the Title column into Bid Number within your SP list, I think there is something wrong with the formula that you provided. The Last(Estimates).Title formula would return a text value rather than a Number value.

Please modify your formula as below:

 

If(
frmSPEstimateList.Mode = FormMode.New,
Value(Last(Estimates).Title) + 1,
Parent.Default
)

Note: I assue that Estimates represents your SP list.

 

 

If the Bid Number is a custom Number type column in your SP list, I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:3.JPG

Please check the following GIF screenshot for more details:Test1.gif

Please also take a try with the following formula:

If(
   frmSPEstimateList.Mode = FormMode.New, 
   Value(Last(SortByColumns(Estimates,"ID",Ascending)).Title) + 1,
   Parent.Default
)

then check if the issue is solved.

If the issue still exists, please take a try to delete/remove the custom form from your SP list, then re-create a new custom form using PowerApps, check if the issue is solved.

More details about deleting custom form from SP list, please check the following article:

Delete custom form

 

Best regards,

Kris

Community Support Team _ Kris Dai
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

llacefield
Level: Powered On

Re: Auto-Increment form SP Online List - Works for awhile and then doesn't increment

The Estimates table is a SP List that I built a PowerApp form. The Title does represent the Bid Number column in my SP list. 

As far as the code, you are correct, it will return a text value instead of a number value. With the field being 'Read-Only' I assumed it would do no harm but not good coding practice, I agree. I will change the code as it might be contributing to an inconsistenecy with the auto-increment.

As far as the issue goes, I was able to find out the underlying issue, and it was due to the 'Data row limit for no n-delegable queries' in 'App Settings'. The value was set to 500. I set the value to 2000 but I see this SP List growing much larger than this. Is there something that I need to do to possibly enahnce this form?

Super User
Super User

Re: Auto-Increment form SP Online List - Works for awhile and then doesn't increment

Hi @llacefield,

i routinely use First(Sort(datasource,ID,Descending)).ID+1 to autoincrement and get around delegation limitations since Sort() is delegatable. Unlike Max or Last, it continues to work as the number of items grows and exceeds the delegation limits.

Tip You can multiply text columns * 1 as a shortcut for Value(text) = text*1

llacefield
Level: Powered On

Re: Auto-Increment form SP Online List - Works for awhile and then doesn't increment

 
llacefield
Level: Powered On

Re: Auto-Increment form SP Online List - Works for awhile and then doesn't increment

Hey @Drrickryp

Just tried @v-xida-msft and it absolutley worlks like a charm!

I do appreciate the code, @v-xida-msft!

Thanks

Bren89
Level: Power Up

Re: Auto-Increment form SP Online List - Works for awhile and then doesn't increment

I found when using First(Sort(datasource,ID,Descending)).ID+1 in default for the text field enrty, It stops counting at 10 and will not process any higher.

 

Does anyone have an solution for this?

I am new to Powerapps and my knowledge to be novice.

Super User
Super User

Re: Auto-Increment form SP Online List - Works for awhile and then doesn't increment

Make sure your ID field is a number not text.

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,285)