cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Holiday requests - adding output from one list, to totals in another

Hi,

 

I'm in the process of creating a holiday request tool in SharePoint 365.

 

I have created two lists thus far:

 

1. A list for employees for them to log their holiday request:

 

 

A.png 

 

 

 

 

2. A list for admin/management:

 

B.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

NB. The 'Days Left' column is a calculated column based on 'Total Days - Days Used'.

 

A) I want to create an approval flow, in order for Management to approve the holiday request.

B) I want to add the 'Number of Days' from list 1, to the 'Days Used' in list 2 (there will only ever be one row per employee in this list).

 

I have the following built so far:

 

C.png

D.png

 

 

 

 

 

 

 

 

 

 

E.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Unfortunately, this is where I get a little lost, IE what syntax I use to drag in the 'Number of Days' for the individual item and apply it to the right employee?

 

I tried the community search function but was unable to find the exact solution to my problem. The closest I came to an asnwer was this post.

 

Any help would be appreciated.

 

Many thanks,

 

Mike.

 

 

3 REPLIES 3
Community Support
Community Support

Re: Holiday requests - adding output from one list, to totals in another

Hi @Polymorph,

 

According to your description, I created two lists, List A and List B.

 

In list A, there are columns name and Number of days.

1.PNG

 

In list B, there are columns name, Total days, days used and Days left (type of calculated).

2.PNG

 

Then in the flow, use the trigger When an item is created. (you could also use when an item is created or modified). Here, use the List A.

 

Then action Initialize variable. Name set as Used, Type as Float, and Value as 0.

 

Then Start an approval action, if the Response is equal to Approved, sent an email to the creator. Then Get items from List B.

 

After Get items action, add Set variable action, name set as Used, select dynamic content Number of days from the trigger for the Value field.

 

Then the Increment variable, Name set as Used, select dynamic content Days used from the Get items action.

 

Finally, use the Update item action to update the days used to List B. And in the field Days used, enter the variable Used.

 

I have tested it on my side and it works fine.

3.PNG

AAA.PNG

 

Please have a try with it.

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
New Member

Re: Holiday requests - adding output from one list, to totals in another

Many thanks, Mabel, your help and the speedy reply are very much appreciated.

 

Unfortunately, I have hit one small snag at the following stage:

 

'After Get items action, add Set variable action, name set as Used, select dynamic content Number of days from the trigger for the Value field.'

 

As I'm looking at list B, I do not have 'Number of Days' as a choice option. I've checked and double checked the preceding actions/content.

 

A51.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Am assuming I've missed something obvious.

 

Kind regards,

 

Mike.

 

Highlighted
New Member

Re: Holiday requests - adding output from one list, to totals in another

Hi Mabel,

 

When you get 5 minutes, would you kindly have another look at this one?

 

Much appreciated,

 

Mike.

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (9,463)