cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Responsive Resident
Responsive Resident

Unable to update Auto increment ID

Hi All

 @v-xida-msft 

 

I'm trying to update the value which will take last value and increment the number by 1, which somehow I got to manage, but the issue here is i have few blanks in between, as I'm using the collection to update the specific column in my sharepoint list, which is the reason I'm getting always the value as 1.

 

is there any alternative to this? using the flow or any thing ? 

 

Formula: This does not shows the value 

 

If (WeeklyFrom_Edit.Mode = FormMode.New, Last('Petty Cash & GL Code').'P_UniqueID ' + 1, Parent.Default)

 

Shows the value 1 as last entry is empty

 

 Last('Petty Cash & GL Code').'P_UniqueID ' + 1

 

 

ScreenShot of Splist

Untitled.png

 

Help is really appreciated. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Unable to update Auto increment ID

Hi @Tapesh ,

Could you please share a bit more about your scenario?

Do you mean that the 'P_UniqueID ' field value of the Lastest entry is Blank?

How many records stored in your SP List? More than 2000?

 

If the records stored in your SP List is not more than 2000, I think the CountRows function could achieve your needs. On your side, you could modify your formula as below:

If(
   WeeklyFrom_Edit.Mode = FormMode.New, 
   CountRows('Petty Cash & GL Code') + 1,
   Parent.Default
)

 

In addition, when you update your existing records in your SP List from Collection, you should also assign a proper value for the 'P_UniqueID ' field. I assume that, you use Patch function to update existing records in your SP List, the standard formula as below:

ForAll(
       YourCollection,
       Patch(
             'Petty Cash & GL Code',
             LookUp('Petty Cash & GL Code', PrimaryColumn = YourCollection[@PrimaryColumn]),
             {
               Column1: YourCollection[@Column1],
               Column2: YourCollection[@Column2],
               ...
               ...,
               'P_UniqueID ': Max('Petty Cash & GL Code', 'P_UniqueID ') + 1
             }
       )
)

 

Best regards,

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

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Unable to update Auto increment ID

Hi @Tapesh ,

Could you please share a bit more about your scenario?

Do you mean that the 'P_UniqueID ' field value of the Lastest entry is Blank?

How many records stored in your SP List? More than 2000?

 

If the records stored in your SP List is not more than 2000, I think the CountRows function could achieve your needs. On your side, you could modify your formula as below:

If(
   WeeklyFrom_Edit.Mode = FormMode.New, 
   CountRows('Petty Cash & GL Code') + 1,
   Parent.Default
)

 

In addition, when you update your existing records in your SP List from Collection, you should also assign a proper value for the 'P_UniqueID ' field. I assume that, you use Patch function to update existing records in your SP List, the standard formula as below:

ForAll(
       YourCollection,
       Patch(
             'Petty Cash & GL Code',
             LookUp('Petty Cash & GL Code', PrimaryColumn = YourCollection[@PrimaryColumn]),
             {
               Column1: YourCollection[@Column1],
               Column2: YourCollection[@Column2],
               ...
               ...,
               'P_UniqueID ': Max('Petty Cash & GL Code', 'P_UniqueID ') + 1
             }
       )
)

 

Best regards,

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published 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 (6,986)