cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jack3
Microsoft
Microsoft

Rerun Flow with different variables

Hi,

 

The flow that I have built pulls a table from an SQL stored procedure and then emails the contents to the relevant individuals. 

 

I have to do this for multiple products and then email to the relevant product team. So I have included a variable in the stored procedure to filter the table by Product, however how do I automate this process in flow, by changing the variable, then rerunning the flow and sending the email to a different product team?

 

I know that i could just create 3 different flows dedicated to each product team. But if it is possible i'd like to keep it within the same flow.

 

Thanks in advance 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Amanthaper
Responsive Resident
Responsive Resident

Hi @jack3 ,

Expanding on what @PrasadAthalye  stated correctly.

A picture is worth thousand words...Here's an example with a different twist.

Source

PAUG_SP2.png

Flow

PAUG_SP1.png

ResultsPAUG_SP3.png

This example loops through the product table, passes the Product id to the Stored Proc to get the email, parses the results from the SP, and emails the proper recipients. Tweak to your liking - hopefully you get the gist.

Cheers,

Aman

------------------------------------------------------------------------------------------------------
If my post helps you with your problem or answers your question, please mark it Solved or Answered. This helps anyone with similar challenges. If you like my response, please give it a Thumbs Up.
------------------------------------------------------------------------------------------------------

View solution in original post

5 REPLIES 5
PrasadAthalye
Super User
Super User

@jack3  - Yes. You can call procedure 3 times within same flow and then use SendEmail action after that to send output. It should work perfectly fine.

 

Like and Mark this as answer if it resolves your issue.

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community

Hi @PrasadAthalye 

 

Thanks for letting me know.

 

How would i go about doing that though?

@jack3  - You can accept parameter to stored Procedure and within the procedure write select statements with if conditions based on the parameter passed. then in the flow, add SQL actions 3 times and call same procedure but just passed different parameter values based on your need and then later use email action.

 

Like and Mark this as a solution if this resolves your issue.

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
Amanthaper
Responsive Resident
Responsive Resident

Hi @jack3 ,

Expanding on what @PrasadAthalye  stated correctly.

A picture is worth thousand words...Here's an example with a different twist.

Source

PAUG_SP2.png

Flow

PAUG_SP1.png

ResultsPAUG_SP3.png

This example loops through the product table, passes the Product id to the Stored Proc to get the email, parses the results from the SP, and emails the proper recipients. Tweak to your liking - hopefully you get the gist.

Cheers,

Aman

------------------------------------------------------------------------------------------------------
If my post helps you with your problem or answers your question, please mark it Solved or Answered. This helps anyone with similar challenges. If you like my response, please give it a Thumbs Up.
------------------------------------------------------------------------------------------------------

Hi @Amanthaper,

 

Thank you so much for your help. 

 

It tried it and it works perfectly thank you. 

 

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 (2,037)