cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
hiti
Helper II
Helper II

auto numbering in power apps and sharepoint

Hi,

 

I have created a power apps form and when I enter all the details and save it, it creates one record in the SharePoint list. In power apps, I have one field priority. When I enter the number it gets saved in SharePoint. Is it possible that when I enter the number other records in SharePoint are incremented with +1. 

 

For Example, I created a record for the HR dept and already 4 records of HR are existing in the list. When I create a new one I want to prioritise that record to number 2, so that the existing number 2 in SharePoint becomes 3 and 3 becomes 4 so on. Is this possible to do from the power apps?

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@hiti 

This gets to be a bit of a performance hog for your app, but yes you can do this.

You can use a formula such as this:

Patch(yourList, 
    ForAll(Filter(yourList, yourCriteriaForRecords) As _item, 
        {ID:_item.ID, Priority: _item.Priority +1}
    )
)

 

Like I say, the larger the number of changes it needs to make, the more time it will take.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
mrleetyler
Resolver I
Resolver I

set your column to be linked to the below variable it should work

Set(LastAddedItem,First(Sort(<DataSource>,ID,SortOrder.Descending)))
RandyHayes
Super User III
Super User III

@hiti 

This gets to be a bit of a performance hog for your app, but yes you can do this.

You can use a formula such as this:

Patch(yourList, 
    ForAll(Filter(yourList, yourCriteriaForRecords) As _item, 
        {ID:_item.ID, Priority: _item.Priority +1}
    )
)

 

Like I say, the larger the number of changes it needs to make, the more time it will take.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,505)