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

Read from Array and apply changes to SharePoint list

Hello,

 

I'm new to Flow and getting started with this great tool. For my current scenario I need some help.

 

What I want: I'm a device manager and I want to hand out several devices to an employee (such as iPhone, Headset, etc. upon onboarding the person). After doing this, my inventory list should be updated.

 

I have two lists in Sharepoint: list A is for the device manager to track a new order and looks like this:

A.PNG

 

List B is my inventory list that looks like this:

B.PNG

 

So far, I was able to write the selected devices to an array. After sending an email to myself with the output of my array variable, it looks like this:

Devices: ["Plantronics Voyager 8200 UC","Apple iPhone 8"]

 

Now, my problem: How can I extend my flow to subtract one device from the Quantity column for the headset and the iPhone?

My expected result should be that there's a 9 in the Quantity column for the headset and the iPhone after I set the Handed Out value to "Ja".

 

Can you help me with this? 🙂

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
henkenTech
Resolver II
Resolver II

Hi there,

 

there is an easy way and a hard way. Let's stick to the easy way:

1. Create a second hidden column called "Handed Out (control)" with default Nein:

Screenshot 2021-04-22 101434.png

2. In your flow, have a condition for Handed Out does not equal Handed Out (control):

Screenshot 2021-04-22 101635.png

3. For the if true branch, add a for each loop to go through the items, subtract 1 from the number and update the item:

Screenshot 2021-04-22 101946.png

4. Finally, update the Handed out (control) to Ja so the flow doesn't loop endlessly:

Screenshot 2021-04-22 102000.png

 

Like I mentioned, there is also a hard way, but let's stick with this one for now 🙂 

 

max

View solution in original post

4 REPLIES 4
henkenTech
Resolver II
Resolver II

Hi there,

 

there is an easy way and a hard way. Let's stick to the easy way:

1. Create a second hidden column called "Handed Out (control)" with default Nein:

Screenshot 2021-04-22 101434.png

2. In your flow, have a condition for Handed Out does not equal Handed Out (control):

Screenshot 2021-04-22 101635.png

3. For the if true branch, add a for each loop to go through the items, subtract 1 from the number and update the item:

Screenshot 2021-04-22 101946.png

4. Finally, update the Handed out (control) to Ja so the flow doesn't loop endlessly:

Screenshot 2021-04-22 102000.png

 

Like I mentioned, there is also a hard way, but let's stick with this one for now 🙂 

 

max

View solution in original post

FancyShoes
New Member

Hey Max,

 

after lots of try and error, I finally got it working.

 

I've some questions left though:

1) How can I create a hidden column that I access in the flow? Because once I hide the column I can't access it anymore in my flow.

2) How would the hard way look like?

henkenTech
Resolver II
Resolver II

Hey there,

 

1. By hidden I just meant that you can remove the column from your primary view, so that user don't have to look at it the whole time :-). If you do that, you need to make sure you select "Use all columns (do not limit)" or another view where the column is shown in the "Limit columns by view" setting of the get actions. 

2. The hard way uses the "Get changes for an item or file" in combination with a HTTP REST call to the SharePoint API to retrieve the previous version of the versioned item. This way you can do away with the second column, but this is much more complex to set up.

 

Hope this helps and happy weekend,


Max

FancyShoes
New Member

Hi Max,

thank you for answering and clarifying everything. I will stick to the easy version, I'm not a developer :D.

 

Happy weekend to you too!

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Users online (66,786)