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
Super User

@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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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.

 

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
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (2,440)