Hi all.
Wondering if anybody could help me?
I have two separate SharePoint lists. One is called Holiday requests, one is called Holiday allocation.
I'm creating a Flow that basically does the following:
When a new item is created in the Holiday request list, find an item in the Holiday allocation list and then update it.
So far it's working all besides one thing. I can't get the Flow to add two values together for the life of me, it find the entry fine and can update the entry but the only way I can get it to work is to replace a value with the new one and not add both together.
Example:
So basically; Add 'Days requested' (from the Holiday request list) and 'Days taken' (from the Holiday allocation list) together and update the Days taken cell to the combined value.
Both of the days request and days remaining would be entered as numbers.
Hi @deankingdk you can do it like this. The HolidayAllocation list has your name in the Title column (which must be unique) and a DaysTaken number column. The HolidayRequest list has your name in the Title column (which of course won't be unique as you'll submit multiple holiday requests) and a DaysRequested number column. I've renamed the Get item below to Get item that was created.
Add a Get items and we want to just bring back your entry in the Holiday Allocation list. So in the advanced options add a filter query of Title eq '{Title}' putting the Title column you selected from the Get item that was created section of the dynamic content inside apostrophes.
Add a Compose control for the DaysTaken from the HolidayAllocation list. That will wrap it in an Apply to each. Everything from here on is inside the Apply to each. Add another Compose control for the DaysRequested from HolidayRequest list:
Add another Compose control and add the outputs of those 2 Compose controls together using an expression of
Then update the HolidayAlllocation list with the output of the addition.
The result is as follows:
Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.
Hi Rob.
Appreciate the reply, just trying it now, keeps failing at this point. The 'Employee' column in the Holiday allocation list is set to People so would need to use the Dynamic content for it?
Any ideas?
Hi @deankingdk,
Unfortunately, Filter query in the Get items does not support Person type, you could consider using the Filter query action after add Get items action without any filter query:
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@deankingdk as well as the filter array solution suggested by @v-litu-msft you can also use arrays and a condition to check if the Employee DisplayName of the Get items from the Allocation list is equal to the Employee DisplayName of the item that was created. If it isn't then do nothing, if it is then do the actions from my previous post. It's working well for me and updates the days taken for that employee.
Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.
Hi Rob.
Got one thing not working now, it's basically when ever I'm trying to find a specific column it's not doing it.
It works if the column is called 'Title' or 'Column' but never when I'm looking for one I've actually named in a list.
So in this list there's a column called National insurance in which it'll have the person's national insurance number.
So the query I'm using is as below but whenever I run it it just says 'A column called National insurance doesn't exist even though it does. Please help!
@deankingdk it's because you have a space in the column name in the SharePoint list. The flow strips it out so in the left hand part of the filter query remove the space and it should work fine. In the example below the SharePoint column is NI Number but the flow only works if the filterquery is NINumber:
Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.
Hi All,
In pretty much any other system I have learnt if you want a to increase by b you say
a=a+b
Or maybe more formally
set a=a+b
Or occasionally something really funky like
set a=add(a,b)
But in Power Automate it seems it is much more complicated.
I have seen the various work arounds using compose etc, I am not asking how to add a to b.
I am asking why is it so complicated? Can anybody explain in words of one syllable?
I feel like I am missing something really fundamental about how Power Automate works and if I could get my head round it a lot of other things would be easier to understand.
Thank you for your help.
Guy
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
29 | |
27 | |
23 | |
17 | |
10 |
User | Count |
---|---|
66 | |
58 | |
29 | |
27 | |
25 |