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

Single Flow workflow which can be triggered on multiple lists with same template

Hi All,

 

How can i create an single flow which can attached to multiple lists? Should trigger on item events when happens in multiple lists

 

Thanks,

Shobha

14 REPLIES 14
ScottShearer
Most Valuable Professional
Most Valuable Professional

@Shobha:

 

Unfortunately Flow does not permit a single Flow to be attached to multiple lists and be used in the manner you have described.  In SharePoint Designer, a reusable workflow could be used for this purpose but that type of functionality is not yet available in Flow.

 

As an alternative, consider having a Flow that takes the actions that you want to have performed.  You can call/start that Flow from another Flow.  So, on each list, have a simple Flow that calls the Flow that performs the work.

 

Here is a link to instructions for calling one Flow form another.

 

If this answers your question, please mark your Post as Solved.

 

Scott

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
v-zhos-msft
Solution Sage
Solution Sage

Hi Shobha ,

As @ Scott said, you can call/start that Flow from another Flow for an alternative.

May be you can use the Add a parallel branch  to trigger multiple lists.

I don’t know whether It can meet you requirement, you can take a try.

322.pngBest Regards,

Zhongys

@Scott , Zhongys

Thanks for your response.

 

So the first workflow trigger is manual start??

 

I want to trigger the workflow when an new item is created. As we have lots of sub sites with same list template. So whenever new item is created in these lists, I want to trigger the workflow automatically.

 

Any suggestion or alternate approach would be appreciated.

 

Thanks,

Shobha

Not sure if you are still looking for this, but I did find a way to get the same Flow to trigger from multiple Lists, and identify which List triggered it.  You use the itemURL to extrapolate the List Name, and Get Lists to go through each List until you find the one you need.

 

Can provide more detail if anyone interested.

 

JK

I need something like that. Can you please provide more detail? Thanks in advance. 

1. The first puzzle is how to set the trigger – it requires a specific List to be specified. Pick any List, as, strangely, it doesn’t matter what you choose.

jkic_8-1612459560296.png


2. Next you need to initialise variables to help us search the List GUIDs to find which one is contained within our List item URL.

jkic_9-1612459597055.png

2a. Get Lists - get all the Lists for your site

jkic_0-1684728929875.png

 

3. The actions below search the results of the Get Lists from your site, and use the Index function to identify a match for a List Name within the List Item URL, using this function
• indexOf(variables('varItemURL'), items('Apply_to_each_Find_List')?['Name'])
The Condition returns an integer (>0) if the List Name is found. Then the List Name can be stored as a variable.

jkic_11-1612459670257.png

 

That’s it really, now you know which List the item was triggered from, and you can get more details of the List Item.

jkic_12-1612459695564.png

 

I use a site column to deploy a column to every list with JSON formatting to display a button. The button action contains the Flow ID to run the above Flow.
Hope this helps.

Anug78
Frequent Visitor

Hello , 
Can you please share the solution how you achieved using URL  ?  My requirement is, I have multiple lists and wanted to trigger same flow for more than one list . 

Hi.  That's exactly what my Flow does.  Although you have to choose a specific List in step 1, it still works for other Lists.  So I specified 'Work Progress Tracker' List, but I can select the Flow from my 'Tasks' List and it works.  Any List on the Site can run this Flow.  If I've misunderstood your question please clarify which of my steps aren't clear or provide your own example. 

Hi jkic, thanks very much to your alternative solution! I was trying it out, but could you help advise further? So I tried to do your method, so firstly I opened an existing flow (ie. Send a customized email when a new SharePoint list item is added).

 

Secondly, I tried to try your No. 2 point above which is to add these 3 steps: 

  • Initialize variable itemurl
  • Initialize variable Index
  • Initialize variable ListName

However, somehow when I search for such variables it seems I cannot find those and only have 'Initialize variable', and I'm not sure how to find the specific ones 'itemUrl', 'Index', 'ListName' as highlighted above. I'm therefore stuck here. I'm a little technologically challenged - so would be helpful for any further help! Thanks very much.

vorlot1_0-1684720771150.jpeg

Hi.  Step 1 - 'When a SharePoint List item is added' is not the trigger you should use.  Use the Sharepoint 'For a selected item' trigger.

Step 2 - Initialise Variable is the action used which creates the variables for you to store values in later.  You can rename the Action by clicking on the 3 dots to the right of the Action name.  I renamed all 3 to make it easier to see what they were for.  Make sure the type is as shown in my screenshot, and leave the value blank.

Thanks so much jkic! I'm able to do Steps 1 & 2, but can I get some clarification on Step 3, in which you stated in your previous responses?: 


3. The actions below Get all the Lists from your site, and use the Index function to identify a match for a List Name within the List Item URL, using this function
• indexOf(variables('varItemURL'), items('Apply_to_each_Find_List')?['Name'])
The Condition returns an integer (>0) if the List Name is found. Then the List Name can be stored as a variable.

- My queries: Does Step 1 & 2 make a trigger, which I now can close, and then implement into other flows?

vorlot1_0-1684725234267.png

From your screenshot above, it looks like you had used the 'Apply to each' function (and renamed it to 'Apply to each Find List'), so I 'Added a new step -> New Action' but in the 'Select an output from previous steps' the 'body/value' doesn't show up: 

vorlot1_1-1684725754603.jpeg

Therefore I wasn't sure if you had applied Step 3 within the same flow of Steps 1 & 2 - or you opened a new flow and applied Step 3 to that? And if yes (to the latter), then could you help? 

I'm not quite sure what you're aiming to do with the first question, but the Flow is not designed to be used/referenced in another Flow.  The Flow allows you to run this exact Flow from multiple Lists.

 

Regarding Step 3, apologies, I didn't screenshot the Get Lists action, which follows the 3 Initialise Variable actions.   The returns the details of all the Lists on your site.  In the Apply to Each you can select 'value' to give you the 'body/value'.  I've revised the screenshots in my original post.

Thanks jkic for being so patient with me! I managed to get through Step 3 as per your screenshot, and copy+pasting this exact phrase: indexOf(variables('varItemURL'), items('Apply_to_each_Find_List')?['Name'])

- However, when I tried to save, the message at the top pops up. As I'm honestly not tech-savvy, I'm not really sure what this means. 

 

vorlot1_0-1684737450080.jpeg

Q: As for the 'The Condition', which I added as a next action - it seems I can manually put the integer to >0. In your original post, did you mean that this would automatically state this if the 'List Name is found'?

Q: A bit of a dumb question as we're already deep into this alternative solution - how do I ensure that when a new meeting list item has been created (or triggered) in any of these lists, so that an email is sent to certain people (ie. this step I would use the 'Send an Email' function). As at the moment based on my shallow understanding, this solution is just to ensure a same workflow to be triggered in any lists - but it's not yet specified what will trigger the workflow (if that makes sense?)

 

Thank you so much for your help, I really appreciate it!

Hi

The formula you've copied refers to 'Apply_to_each_Find_List'.  Your apply to Each action must be named exactly that for it to work.  Yours is just called 'Apply_to_each'.  Either rename the Action, or amend the formula to use the correct name.

 If the List name is found, Set Variable will set varIndex to a value greater than zero, so then the Condition returns true.

No such thing as a dumb question...if I understand you want an email to be sent to people when an item is added, and this should work on several Lists.  My solution was deployed as a button displayed next to each List item.  Users added a new item then clicked a 'Request Approval' button, which appeared/disappeared depending on the Status of the List item.  The button is effectively a bit of json formatting which presents as a button and has an action to run the Flow.  If you want to run the Flow (send the email) automatically this might not be the right solution.  I'm just thinking how it might be adapted.......I see now why you used the 'When a new item is added' trigger, but that limits you to the List specified.  Probably depends how many Lists you have to do this for, but the only thing I can suggest is creating parent Trigger Flows for each List which all call the same child Flow (which sends the email).  Alternatively you could Schedule a single Flow which checks all Lists for new items (Get Lists, followed by Get Items in an Apply to Each loop) and sends an email.  That's probably best if it doesn't have to be 'real time'.  You'd need to consider limits on running Flows before deciding Frequency, but e.g. every 15 minutes could work. 

  

Helpful resources

Announcements

Calling all User Group Leaders and Super Users! Mark Your Calendars for the next Community Ambassador Call on May 9th!

This month's Community Ambassador call is on May 9th at 9a & 3p PDT. Please keep an eye out in your private messages and Teams channels for your invitation. There are lots of exciting updates coming to the Community, and we have some exclusive opportunities to share with you! As always, we'll also review regular updates for User Groups, Super Users, and share general information about what's going on in the Community.     Be sure to register & we hope to see all of you there!

April 2024 Community Newsletter

We're pleased to share the April Community Newsletter, where we highlight the latest news, product releases, upcoming events, and the amazing work of our outstanding Community members.   If you're new to the Community, please make sure to follow the latest News & Announcements and check out the Community on LinkedIn as well! It's the best way to stay up-to-date with all the news from across Microsoft Power Platform and beyond.    COMMUNITY HIGHLIGHTS   Check out the most active community members of the last month! These hardworking members are posting regularly, answering questions, kudos, and providing top solutions in their communities. We are so thankful for each of you--keep up the great work! If you hope to see your name here next month, follow these awesome community members to see what they do!   Power AppsPower AutomateCopilot StudioPower PagesWarrenBelzDeenujialexander2523ragavanrajanLaurensMManishSolankiMattJimisonLucas001AmikcapuanodanilostephenrobertOliverRodriguestimlAndrewJManikandanSFubarmmbr1606VishnuReddy1997theMacResolutionsVishalJhaveriVictorIvanidzejsrandhawahagrua33ikExpiscornovusFGuerrero1PowerAddictgulshankhuranaANBExpiscornovusprathyooSpongYeNived_Nambiardeeksha15795apangelesGochixgrantjenkinsvasu24Mfon   LATEST NEWS   Business Applications Launch Event - On Demand In case you missed the Business Applications Launch Event, you can now catch up on all the announcements and watch the entire event on-demand inside Charles Lamanna's latest cloud blog.   This is your one stop shop for all the latest Copilot features across Power Platform and #Dynamics365, including first-hand looks at how companies such as Lenovo, Sonepar, Ford Motor Company, Omnicom and more are using these new capabilities in transformative ways. Click the image below to watch today!   Power Platform Community Conference 2024 is here! It's time to look forward to the next installment of the Power Platform Community Conference, which takes place this year on 18-20th September 2024 at the MGM Grand in Las Vegas!   Come and be inspired by Microsoft senior thought leaders and the engineers behind the #PowerPlatform, with Charles Lamanna, Sangya Singh, Ryan Cunningham, Kim Manis, Nirav Shah, Omar Aftab and Leon Welicki already confirmed to speak. You'll also be able to learn from industry experts and Microsoft MVPs who are dedicated to bridging the gap between humanity and technology. These include the likes of Lisa Crosbie, Victor Dantas, Kristine Kolodziejski, David Yack, Daniel Christian, Miguel Félix, and Mats Necker, with many more to be announced over the coming weeks.   Click here to watch our brand-new sizzle reel for #PPCC24 or click the image below to find out more about registration. See you in Vegas!       Power Up Program Announces New Video-Based Learning Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram. These include a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the image below to find out more!   UPCOMING EVENTS Microsoft Build - Seattle and Online - 21-23rd May 2024 Taking place on 21-23rd May 2024 both online and in Seattle, this is the perfect event to learn more about low code development, creating copilots, cloud platforms, and so much more to help you unleash the power of AI.   There's a serious wealth of talent speaking across the three days, including the likes of Satya Nadella, Amanda K. Silver, Scott Guthrie, Sarah Bird, Charles Lamanna, Miti J., Kevin Scott, Asha Sharma, Rajesh Jha, Arun Ulag, Clay Wesener, and many more.   And don't worry if you can't make it to Seattle, the event will be online and totally free to join. Click the image below to register for #MSBuild today!   European Collab Summit - Germany - 14-16th May 2024 The clock is counting down to the amazing European Collaboration Summit, which takes place in Germany May 14-16, 2024. #CollabSummit2024 is designed to provide cutting-edge insights and best practices into Power Platform, Microsoft 365, Teams, Viva, and so much more. There's a whole host of experts speakers across the three-day event, including the likes of Vesa Juvonen, Laurie Pottmeyer, Dan Holme, Mark Kashman, Dona Sarkar, Gavin Barron, Emily Mancini, Martina Grom, Ahmad Najjar, Liz Sundet, Nikki Chapple, Sara Fennah, Seb Matthews, Tobias Martin, Zoe Wilson, Fabian Williams, and many more.   Click the image below to find out more about #ECS2024 and register today!     Microsoft 365 & Power Platform Conference - Seattle - 3-7th June If you're looking to turbo boost your Power Platform skills this year, why not take a look at everything TechCon365 has to offer at the Seattle Convention Center on June 3-7, 2024.   This amazing 3-day conference (with 2 optional days of workshops) offers over 130 sessions across multiple tracks, alongside 25 workshops presented by Power Platform, Microsoft 365, Microsoft Teams, Viva, Azure, Copilot and AI experts. There's a great array of speakers, including the likes of Nirav Shah, Naomi Moneypenny, Jason Himmelstein, Heather Cook, Karuana Gatimu, Mark Kashman, Michelle Gilbert, Taiki Y., Kristi K., Nate Chamberlain, Julie Koesmarno, Daniel Glenn, Sarah Haase, Marc Windle, Amit Vasu, Joanne C Klein, Agnes Molnar, and many more.   Click the image below for more #Techcon365 intel and register today!     For more events, click the image below to visit the Microsoft Community Days website.      

Tuesday Tip | Update Your Community Profile Today!

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   We're excited to announce that updating your community profile has never been easier! Keeping your profile up to date is essential for staying connected and engaged with the community.   Check out the following Support Articles with these topics: Accessing Your Community ProfileRetrieving Your Profile URLUpdating Your Community Profile Time ZoneChanging Your Community Profile Picture (Avatar)Setting Your Date Display Preferences Click on your community link for more information: Power Apps, Power Automate, Power Pages, Copilot Studio   Thank you for being an active part of our community. Your contributions make a difference! Best Regards, The Community Management Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Super User of the Month | Ahmed Salih

We're thrilled to announce that Ahmed Salih is our Super User of the Month for April 2024. Ahmed has been one of our most active Super Users this year--in fact, he kicked off the year in our Community with this great video reminder of why being a Super User has been so important to him!   Ahmed is the Senior Power Platform Architect at Saint Jude's Children's Research Hospital in Memphis. He's been a Super User for two seasons and is also a Microsoft MVP! He's celebrating his 3rd year being active in the Community--and he's received more than 500 kudos while authoring nearly 300 solutions. Ahmed's contributions to the Super User in Training program has been invaluable, with his most recent session with SUIT highlighting an incredible amount of best practices and tips that have helped him achieve his success.   Ahmed's infectious enthusiasm and boundless energy are a key reason why so many Community members appreciate how he brings his personality--and expertise--to every interaction. With all the solutions he provides, his willingness to help the Community learn more about Power Platform, and his sheer joy in life, we are pleased to celebrate Ahmed and all his contributions! You can find him in the Community and on LinkedIn. Congratulations, Ahmed--thank you for being a SUPER user!

Tuesday Tip: Getting Started with Private Messages & Macros

Welcome to TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   This Week's Tip: Private Messaging & Macros in Power Apps Community   Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member!   Our Knowledge Base article about private messaging and macros is the best place to find out more. Check it out today and discover some key tips and tricks when it comes to messages and macros:   Private Messaging: Learn how to enable private messages in your community profile and ensure you’re connected with other community membersMacros Explained: Discover the convenience of macros—prewritten text snippets that save time when posting in forums or sending private messagesCreating Macros: Follow simple steps to create your own macros for efficient communication within the Power Apps CommunityUsage Guide: Understand how to apply macros in posts and private messages, enhancing your interaction with the Community For detailed instructions and more information, visit the full page in your community today:Power Apps: Enabling Private Messaging & How to Use Macros (Power Apps)Power Automate: Enabling Private Messaging & How to Use Macros (Power Automate)  Copilot Studio: Enabling Private Messaging &How to Use Macros (Copilot Studio) Power Pages: Enabling Private Messaging & How to Use Macros (Power Pages)

Users online (3,185)