cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

Next incremental Number of a Number Field In a SharePoint List (Warning)

Hi all, 

 

So i have been trying to get the next incremental number on a Sharepoint List field (number) and i am using this code in the default property of this field in the powerapp form: 

 

Max(Filter(RRF, true),'RRF ID')+1

 

Where RRF is the datasource (sharepoint list) and RRF ID is the field name 

 

It is working fine but i have a warning: This predicate is a literal value and does not reference the input table

 

Can i ignore this message or will it effect the application somehow ?

1 ACCEPTED SOLUTION

Accepted Solutions
Power Apps
Power Apps

You're getting this message because of the nested expression

Filter(RRF, true)

You are filtering the data source, but the expression that you use does not reference any columns from it - this is usually an error, as that expression is equivalent to

RRF

If it is not an error in your part, then yes, you can ignore it.

There is another issue, however - if the number of items in your SP list starts growing, you may reach the delegation limit (the 'Max' function is not delegated (for more information on delegation, see this link). One way to work around this would be to sort the items based on your column in a descending way, and take the first element (which would be the higher):

First(SortByColumns(RRF, "RRFID", Descending)).'RRF ID' + 1

You may still see a delegation warning (that the 'First' function cannot be delegated to SharePoint), but that would be ok as it would apply to a sorted result.

Having said all that, I believe that SharePoint does have by default an auto-incremented id for items of its lists. The column "ID" is hidden, but you can show it in your sharepoint list (and access it from Power Apps), so you may not need to calculate it - let SharePoint do it for you.

Hope this helps!

View solution in original post

2 REPLIES 2
Power Apps
Power Apps

You're getting this message because of the nested expression

Filter(RRF, true)

You are filtering the data source, but the expression that you use does not reference any columns from it - this is usually an error, as that expression is equivalent to

RRF

If it is not an error in your part, then yes, you can ignore it.

There is another issue, however - if the number of items in your SP list starts growing, you may reach the delegation limit (the 'Max' function is not delegated (for more information on delegation, see this link). One way to work around this would be to sort the items based on your column in a descending way, and take the first element (which would be the higher):

First(SortByColumns(RRF, "RRFID", Descending)).'RRF ID' + 1

You may still see a delegation warning (that the 'First' function cannot be delegated to SharePoint), but that would be ok as it would apply to a sorted result.

Having said all that, I believe that SharePoint does have by default an auto-incremented id for items of its lists. The column "ID" is hidden, but you can show it in your sharepoint list (and access it from Power Apps), so you may not need to calculate it - let SharePoint do it for you.

Hope this helps!

View solution in original post

Thanks so much worked perfect. Yes i got delegation warning, Nice Trick with the sorting

 

Cheers again. 

 

Regarding using the sharepoint ID as the RRF ID, I wanted to have some more control on the ID's are being added so that if the need arises to delete the list row then I can reuse the RRF ID that was deleted. If I use the sharepoint ID and delete the row, i cannot reuse the ID. 

 

But yes agree sharepoint ID as increment is very useful, using it in various other lists.  

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

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