cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Polymorph
Level: Powered On

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 Team
Community Support Team

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.
Polymorph
Level: Powered On

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.

 

Polymorph
Level: Powered On

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

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 66 members 4,461 guests
Please welcome our newest community members: