cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tapesh
Post Prodigy
Post Prodigy

How to Increase value by 1 number ignore if blank

Hi all, 

Im trying to add functionality like auto-incremnet id, how ever i have checked some of the solutions, tried and tested but seems to be like not working for me as i have few blank between two records in my sharepoint list. 

 

Firstly I tried using

 

 

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

 

 

 

which however gave me this result

Tapesh_0-1600864233325.png

as there are no records in the last columns hence it returned the value 1. But i want to acheive that it checks the last few records and then see the value and increase the value by 1, or else should ignore the blank and only check the value and then add 1 to it.  Please the sharepoint list photo below which has few blanks but it has 61 as the last entered records.

 

Tapesh_1-1600864381417.png

 

any helpy by experts or can you please correct me would be really appriciated. 

 

Thanks 😄  @mdevaney 

   

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi,

 

Please give a try the following:

If(!IsBlank( WeeklyFrom_Edit.LastSubmit.'Unit Name'), Patch('Petty Cash & GL Code', LookUp('Petty Cash & GL Code', ID = WeeklyFrom_Edit.LastSubmit.ID), { P_UniqueID : First(Sort('Petty Cash & GL Code','P_UniqueID ', Descending)).'P_UniqueID ' +1 }));

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

 

View solution in original post

3 REPLIES 3
RandyHayes
Super User III
Super User III

@Tapesh 

If I understand you correct, you want to increase records that have a value in P_UniqueID if they are NOT blank.  If that is the case, you can consider the following formula:

First(SortByColumns('Petty Cash & GL Code' , P_UniqueID, Descending).P_UniqueID + 1

 This will sort the columns first by the UniqueID (descending).  This will put empty ones at the bottom of the sort (last) and then take the first value in the sort which will be the highest number...then add 1 to it.

 

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!

Hi,

 

Please give a try the following:

If(!IsBlank( WeeklyFrom_Edit.LastSubmit.'Unit Name'), Patch('Petty Cash & GL Code', LookUp('Petty Cash & GL Code', ID = WeeklyFrom_Edit.LastSubmit.ID), { P_UniqueID : First(Sort('Petty Cash & GL Code','P_UniqueID ', Descending)).'P_UniqueID ' +1 }));

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

 

View solution in original post

JohnTurner
New Member

This is how i did it today, the patch look to the SharePoint List (My Training) then the Record within using two variables (Title matched selected training Title, and the current users Email matched the assigned to record)

Once it has the record it is adding +1 to the "ReminderSent" column that is a SharePoint Number Column

Then adding Todays date to the "ReminderSentDate" Column that is a Date Column.

It will + 1 everytime in the ReminderSent

ReminderSent:ThisItem.ReminderSent +1,
ReminderSentDate:Today()

//--------- Full patching Code

Patch(
'My Training',
LookUp(
'My Training',
selectedTitle = 'Title' &&
ThisItem.'Assigned To Email' = 'Assigned To Email'
),
{
ReminderSent:ThisItem.ReminderSent +1,
ReminderSentDate:Today()
}
);

//------END


First Reminder
https://ibb.co/W6nzBZS
Reminder 1

 

Second Reminder...
https://ibb.co/WPhQNcy
Reminder 2

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 (933)