cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GaryHounslow
Helper III
Helper III

Stock Level Control

Hi all,

I am trying to create a Flow that will work like a Stock Control.  The data is stored in 2 separate Sharepoint lists.  One that displays current stock levels for multiple items and one that is updated when any stock goes out or comes in.

The idea is that if you add an entry for any stock going out or coming in, Flow will automatically adjust the stock levels in the other list.

I have started the Flow but got stuck on the update item step (where it should adjust the levels of the stock), it needs the ID of the item to update in the list but I am unsure how to get this.  I need to be able to get the ID based on what the item name is if that makes sense?

 

Has anybody setup something similar before and could give some pointers?

 

Many thanks

Gary

1 ACCEPTED SOLUTION

Accepted Solutions
faustocapellanj
Memorable Member
Memorable Member

Hi @GaryHounslow

 

This is a very common scenario in Flow. The main thing you need between both lists is a field that works as a unique ID, or as a Primary Key in database terms. For example, you can use the Title column from each list, and when you add or update an item in List A, you do a Get Items from List B matching the unique ID from the item in List A. If Flow finds it, then you can proceed to perform the Update Item action.

 

So you can have an idea, I have added a link below to one of the very first solutions I helped build with a user in the Flow Community board. Go through the post so you can see his scenario and then look at the solution; it should point you in the right direction. And if you have any questions, please do not hesitate to reach out.

https://powerusers.microsoft.com/t5/Building-Flows/How-to-check-if-an-item-exists-on-a-SharePoint-li...

 

Regards,

Fausto Capellan, Jr

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

View solution in original post

4 REPLIES 4
faustocapellanj
Memorable Member
Memorable Member

Hi @GaryHounslow

 

This is a very common scenario in Flow. The main thing you need between both lists is a field that works as a unique ID, or as a Primary Key in database terms. For example, you can use the Title column from each list, and when you add or update an item in List A, you do a Get Items from List B matching the unique ID from the item in List A. If Flow finds it, then you can proceed to perform the Update Item action.

 

So you can have an idea, I have added a link below to one of the very first solutions I helped build with a user in the Flow Community board. Go through the post so you can see his scenario and then look at the solution; it should point you in the right direction. And if you have any questions, please do not hesitate to reach out.

https://powerusers.microsoft.com/t5/Building-Flows/How-to-check-if-an-item-exists-on-a-SharePoint-li...

 

Regards,

Fausto Capellan, Jr

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!
v-bacao-msft
Community Support
Community Support

Hi @GaryHounslow,

 

I agree with faustocapellanj suggestion.

You may need to set things like primary key for these two lists, so that when one of the list item changes, you could use this primary key to find corresponding item in another list, and then change it.

Could you please share a full screenshot of the configuration of your flow?

Please provide more details and which should be helpful for us to share a further suggestion.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
GaryHounslow
Helper III
Helper III

I have figured out a way around this now, the item field in the list is now a lookup field which also pulls back the ID of the item 🙂

 

Another query though, how do you put simple maths in to Flow?  For example, add an item to the sharepoint stock control list and choose how many items are going out (or coming in) and then have flow alter the stock level amount for the corresponding item in the list based on what was entered?

So when doing the update item task in the Flow, in the stock level field it should be "stock level + Items in" or "stock level - Items out"

 

I hope that makes sense

 

Gary

GaryHounslow
Helper III
Helper III

I have figured this out now.

Thank you both for your replies, they pushed me in the right direction.

 

Gary

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (969)