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

Inventory Update Flow Not Working

I am trying to simply update a product inventory list (subtract 1) when a new item is added to an order list.  The flow runs successfully but does not update the Current Inventory field after a product is added.Run History _ Po.png

14 REPLIES 14
RobElliott
Super User
Super User

@afaw as you are running the flow after each item is created your first action should be get item not get items. Then you can get rid of that apply to each control. What is in your condition?

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.

MarvinBangert
Super User
Super User

Hey @afaw 

can you please share more information about your formular within your condition?

Also your compose looks like just a text, instead of an expression, can you also show this action within flow edit mode?

 

Thanks in advance!

 

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

I tried Get Item and doesn't flow get Action 'Get_item' failed.  The condition is simply matching the Inventory IDs.

Sure, the formula is sub(CurrentInventory, 1)

MarvinBangert
Super User
Super User

Hey @afaw 

instead of a condition, please consider using the Filter Query within your SharePoint "Get items" filter, using something like

<Your Internal SharePoint Column Name> eq <dynamic value from your trigger>

example:
InventoryID eq 1

This will only return the items which meets your Filter, without getting every item and checking it in your flow using the condition. You can find more information here: Filter Query in SharePoint Get Items in Power Automate (sharepains.com)

 

With the Compose:

I meant it looks like you added the formula just as text into the "Inputs" like this, when you edit the flow:

MarvinBangert_0-1635875975766.png

It should look something like this:

MarvinBangert_1-1635876004588.png

When you click into the "Inputs" it should open a pane on the right side, where you can enter an "Expression":

MarvinBangert_2-1635876049541.png

I used a text for "CurrentInventory", you would need to use the dynamic value from your Trigger or SharePoint - Get items action.

 

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

I need Sharepoint to use the number in Current Inventory and minus -1 from it.

I now see the get items is looking at a different list, so my original comment was incorrect. But you do seem to have a problem with the compose action which subtracts the inventory number and updates it. Have you added it as an expression, not text, as @MarvinBangert has suggested?

 

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.

I have tried both ways as Dynamic and Expression, neither works.

MarvinBangert
Super User
Super User

Could you share a Screenshot or the expression to us, so we can have a look on this?

 

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

I think i've got the flow down now but the formula isn't working because the output shows the same inventory before order was added.  See formula.Edit your flow _.png

You still haven't got the creation of the expression right: you're typing into the field which is wrong. In the Compose you click in the field then in the dynamic content box on the right you click on the Expression tab then enter the expression there, selecting where necessary the dynamic content from that tab. You need to create your expressions properly or it's never going to work.

 

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.

Got it.  However, I can't choose the Current Inventory dynamic field from the Expression within the formula.

MarvinBangert
Super User
Super User

Hey @afaw 

you can switch between the Expression and Dynamic Field Tab, when you write your expression, it will get attached to your expression and you can switch back or do you mean, that the dynamic field is not visible, when you switch over to the dynamic field?

 

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

The dynamic field isn't visible.

Helpful resources

Announcements
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.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (2,864)