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

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
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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

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

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
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 (14,017)