cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pcpatter
Frequent Visitor

Creating a Flow for an Inventory Reorder Email

I have a sharepoint list containing all our inventory items. There is a column for "actual quantitiy" and a column for "minimum quantity". I am trying to find a way to send an email containing all the line items where "actual quantity" is less than or equal to "minimum quantity". I am flexible on how this can be accomplished. Perhaps it generates a table of all the line items that fits the condition and emails the table or a link to the generated table. I just don't want it to be one email per line item (as this could be 50+ and it would not be useful). Any help on how to set up this workflow would be very appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions

For the append to array variable step what do I put for "value"? I am guessing I am not choosing a correct option as I get this error

Flow save failed with code 'WorkflowRunActionInputsInvalidProperty' and message 'The inputs of workflow run action 'Append_to_array_variable' of type 'AppendToArrayVariable' are not valid. Self reference is not supported when updating the value of variable 'A'.'.

View solution in original post

10 REPLIES 10
Sundeep_Malik
Community Champion
Community Champion

Hey @pcpatter 

You can initialize an array variable. And whenever the condition gets true, append it to that array. After the apply to each ends, after that just send one email with all the array values.

 

Sundeep_Malik_0-1664598188851.png

Sundeep_Malik_3-1664598322751.png

 

Sundeep_Malik_2-1664598302189.png

 

And if you want to send it in a format:

You can also use create csv table and pass the array in it before the mail action:

Sundeep_Malik_4-1664598497008.png

 

For the append to array variable step what do I put for "value"? I am guessing I am not choosing a correct option as I get this error

Flow save failed with code 'WorkflowRunActionInputsInvalidProperty' and message 'The inputs of workflow run action 'Append_to_array_variable' of type 'AppendToArrayVariable' are not valid. Self reference is not supported when updating the value of variable 'A'.'.

Sundeep_Malik
Community Champion
Community Champion

@pcpatter 

Put the name of the item. 

Ok thanks. I will try to figure this out. I am basically as beginner as you get so I don't understand what you mean by "name of item" as it is a full line from a spreadsheet. Would I put all the dynamic content for all the columns I want reported?

I also don't know what should go in the parenthesis for the variable function. 

Sundeep_Malik
Community Champion
Community Champion

@pcpatter 

Actually directly I am not sure you will be able to get the array variable(not sure why)

So, I just wrote

variables('A')

So, I wanted to ask you just want to notify yourself that this particular item has reached minimum quantity? So that's why I said just to send the name of the item.

The output will be used to place an order so in a perfect world it would include some minimum amount of information from the sharepoint list. Namely the catalog #, description, actual quantity, minimum quantity. This would be all the information needed to place the order and know how many to order. 

Sundeep_Malik
Community Champion
Community Champion

@pcpatter 

Ok then try adding all the things in that append. See if you are getting the appropriate result. Otherwise make separate variables for each.

I tried to run it but the email never comes in so I don't know where I am going wrong now unfortunately

Sundeep_Malik
Community Champion
Community Champion

@pcpatter 

Can you share your flow ss in edit mode?

I showed my husband your workflow and he was able to get it to work see he better knows what should actually go in as inputs! Thanks!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (4,647)