cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Highlighted
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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (7,464)