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

How do you change the initial trigger in a flow?

I created a flow based on a trigger if an item was added or modified from a sharepoint list.  I want to change this to just if one particular field is modified, but i don't know how to do that.  Is the only way to rebuild the flow from scratch?

19 REPLIES 19
Mike2500
Impactful Individual
Impactful Individual

1. You can change the trigger by deleting the original trigger and then simply adding a different one. Complicating this procedure is the fact that you can't delete the trigger if any other components are using fields from it. So, if you had an email action that used fields from the trigger, you'd have to remove those fields from the email before getting rid of the trigger.

 

2. There is no trigger to start a flow from modifying a particular field of a list. The old way of doing this is to have an extra field to store the older value, and then compare them. For example, if your field is "status", create a new field called "status_old". The flow would fire for every list change, and would compare those values. If the values were different, then it should proceed on, doing whatever it needed to do, and then update status_old with the current value in status.

So basically, you would have to remove everything in the flow in order to remove the first trigger - essentially rebuilding it.

I've accidentally created a loop by having the trigger be create or modify an item at the end of my flow I have it update to Yes, if an item is approved - hence triggering another round of emails.  I really need it to be if it is just changing one field.  Doesn't sound like the old way would work for me anymore since the trigger is modifying a list.  I guess I'll just turn off the flow to do a manual update for now.  Thanks for your input!

ch2017
Advocate III
Advocate III

in my case i had a long & complex workflow i din't want to recreate from scratch - especially since MS Flow kept complaining about dependencies between the trigger & actions that i could not find when i tried to remove the original trigger

 

so i found this workaround

  • export the workflow as a zip package (option "create as new")
  • make sure to rename the original workflow to avoid conflicts when importing
  • unzip the package file, look for the definition.json file
  • replace the trigger by editing the file:
    in case of a different trigger on the same connection it is rather straightforward, in my case i replaced "When_an_item_is_created" with "When_an_item_is_created_or_modified" , "GetOnNewItems" with "GetOnUpdatedItems" and "onnewitems" with "onupdateditems"
  • recreate the zipfile (make sure the Microsoft.Flow folder is in the root of the zip file)
  • reimport the package, the flow is now triggered by the new action

 

in case you have a different datasource the edit may be more complex, just create 2 small workflows, one with each trigger, export them and look for the differences in their JSON files to help you in the right direction

Hi Ch2017,

 

that is a great idea, just got the problem, that i can not export a package ....

 

image.png

 

Actually i do not understand why as I am logged in with my Admin Account with an e3 License. 

Is there an requirement for a special License?

 

 

in terms of license there is no reason you are not able to export

Jim_Bu
Frequent Visitor

This doesn't seem to work.  When I change "When_a_file_is_created_or_modified_(properties_only)" to "When_a_file_is_created_(properties_only)" I get an unknown error on import.

rr19
Regular Visitor

I have the same issue. When I try to import the package it just says "Something wnet wrong. Please try again later." Have you found a solution?

this still works, just tested the change from "when item is created" to "when item is created or updated", no problem to import and use the edited version, there is also no reason that it would'n work as the JSON implementation is the same as two years ago

i have the same error when i forget to put the Microsoft.Flow at the root of the ZIP, so check that requirement

Jim_Bu
Frequent Visitor

Is there some missing hidden step? I've literally done nothing more than extract the zip, change the single line, and rezipped directory.

if you drop the exports (original and modified version) somewhere to download i can check what is wrong, be aware that some files may contain usernames so maybe remove them first

@ch2017  please how do i put Microsoft.Flow at the root of the ZIP

just create a subfolder called Microsoft.Flow and ZIP the parent folder to match the folder structure of the export file

efialttes
Community Champion
Community Champion

Posted by mistake


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Ario
Regular Visitor

Another workaround can be this:

create a dummy condition like 1=1 and put all your code into this condition(works as a wrapper, I don't know a better way of making a wrapper for your code,  there should be though), then copy it to the clipboard and paste it into a new flow that you created with the right trigger that you fancy. you need to fix the input of the actions that use the trigger output at the end, and tada!

Ario
Regular Visitor

an easier workaround is to copy the actions to clipboard and paste them into the new flow that you created with the right trigger. if there are many actions, I can suggest to create a wrapper to contain all your code, I normally do put everything into a always-true condition like 1=1, and this gives me more flexibility to move things around. I just copy the condition to clipboard and then can paste it in any other flow.

efialttes
Community Champion
Community Champion

@Ario 

Good point! An alternate wrapper is 'Scope' action block

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



CW
Post Prodigy
Post Prodigy

As per usual with msft, THIS IS NUTS!!!!

 

I'm not doing any packages or anytghing! I have a good idea, ALLOW THE FLOW TRIGGER TO BE CHANGED AT THE EXISTING TRIGGER!!! HELLLLLOOOOOOO MICROSOFT.

 

Yet another very very VERY simple issue "overlooked".

 

Aye yi yi yi yi. I don't beleive this company, every functionality is incomplete and useful, valuable, evertyday, mundane, expected functionality perennially "overlooked".

 

To perform a simple trigger change you have to go through all that rigamarole? But what if it's a Tuesday with a full moon? I suppose it wont work then. 

With any container, you need to push your variable declarations to the top level and copy them one by one.  So it helps, but could lead to omissions

Helpful resources

Announcements

Power Platform Connections Ep 14 | J. Panchal | Thursday, 18 May 2023

Episode Fourteen of Power Platform Connections sees David Warner and Hugo Bernier talk to Microsoft PM Jocelyn Panchal, alongside the latest news, videos, product reviews, and community blogs.     Use the hashtag #PowerPlatformConnects on social media for a chance to have your work featured on the show.      Show schedule in this episode:  00:00 Cold Open 00:32 Show Intro 01:10 Jocelyn Panchal Interview 24:10 Blogs & Articles 29:50 Outro & Bloopers  Check out the blogs and articles featured in this week’s episode:   https://www.nathalieleenders.com/Blog/index.php/;focus=STRATP_com_cm4all_wdn_Flatpress_42136159&path=?x=entry:entry230511-101930#C_STRATP_com_cm4all_wdn_Flatpress_42136159__-anchor  @NathLeenders https://www.keithatherton.com/posts/2023-05-12-msbuild2023-cloud-skills-challenge/  @MrKeithAtherton https://elliskarim.com/2023/05/13/how-to-find-files-in-onedrive-that-match-a-naming-pattern/  @MrCaptainKarim https://www.linkedin.com/pulse/my-fond-memories-scottish-summit-2022-pranav-khurana/ @pranavkhuranauk https://www.linkedin.com/feed/update/urn:li:activity:7061777660745560064/?updateEntityUrn=urn%3Ali%3Afs_feedUpdate%3A%28V2%2Curn%3Ali%3Aactivity%3A7061777660745560064%29  @thevictordantas  Action requested: Feel free to provide feedback on how we can make our community more inclusive and diverse.  This episode premiered live on our YouTube at 12pm PST on Thursday 18th May 2023.  Video series available at Power Platform Community YouTube channel.  Upcoming events:  Power Apps Developers Summit – May 19-20th - London European Power Platform conference – Jun. 20-22nd - Dublin Microsoft Power Platform Conference – Oct. 3-5th - Las Vegas  Join our Communities:  Power Apps Community Power Automate Community Power Virtual Agents Community Power Pages Community  If you’d like to hear from a specific community member in an upcoming recording and/or have specific questions for the Power Platform Connections team, please let us know. We will do our best to address all your requests or questions.   

May 2023 Community Newsletter and Upcoming Events

Welcome to our May 2023 Community Newsletter, where we'll be highlighting the latest news, releases, upcoming events, and the great work of our members inside the Biz Apps communities. If you're new to this LinkedIn group, be sure to subscribe here in the News & Announcements to stay up to date with the latest news from our ever-growing membership network who "changed the way they thought about code".         LATEST NEWS "Mondays at Microsoft" LIVE on LinkedIn - 8am PST - Monday 15th May  - Grab your Monday morning coffee and come join Principal Program Managers Heather Cook and Karuana Gatimu for the premiere episode of "Mondays at Microsoft"! This show will kick off the launch of the new Microsoft Community LinkedIn channel and cover a whole host of hot topics from across the #PowerPlatform, #ModernWork, #Dynamics365, #AI, and everything in-between. Just click the image below to register and come join the team LIVE on Monday 15th May 2023 at 8am PST. Hope to see you there!     Executive Keynote | Microsoft Customer Success Day CVP for Business Applications & Platform, Charles Lamanna, shares the latest #BusinessApplications product enhancements and updates to help customers achieve their business outcomes.         S01E13 Power Platform Connections - 12pm PST - Thursday 11th May Episode Thirteen of Power Platform Connections sees Hugo Bernier take a deep dive into the mind of co-host David Warner II, alongside the reviewing the great work of Dennis Goedegebuure, Keith Atherton, Michael Megel, Cat Schneider, and more. Click below to subscribe and get notified, with David and Hugo LIVE in the YouTube chat from 12pm PST. And use the hashtag #PowerPlatformConnects on social media for a chance to have your work featured on the show.         UPCOMING EVENTS   European Power Platform Conference - early bird ticket sale ends! The European Power Platform Conference early bird ticket sale ends on Friday 12th May 2023! #EPPC23 brings together the Microsoft Power Platform Communities for three days of unrivaled days in-person learning, connections and inspiration, featuring three inspirational keynotes, six expert full-day tutorials, and over eighty-five specialist sessions, with guest speakers including April Dunnam, Dona Sarkar, Ilya Fainberg, Janet Robb, Daniel Laskewitz, Rui Santos, Jens Christian Schrøder, Marco Rocca, and many more. Deep dive into the latest product advancements as you hear from some of the brightest minds in the #PowerApps space. Click here to book your ticket today and save!      DynamicMinds Conference - Slovenia - 22-24th May 2023 It's not long now until the DynamicsMinds Conference, which takes place in Slovenia on 22nd - 24th May, 2023 - where brilliant minds meet, mingle & share! This great Power Platform and Dynamics 365 Conference features a whole host of amazing speakers, including the likes of Georg Glantschnig, Dona Sarkar, Tommy Skaue, Monique Hayward, Aleksandar Totovic, Rachel Profitt, Aurélien CLERE, Ana Inés Urrutia de Souza, Luca Pellegrini, Bostjan Golob, Shannon Mullins, Elena Baeva, Ivan Ficko, Guro Faller, Vivian Voss, Andrew Bibby, Tricia Sinclair, Roger Gilchrist, Sara Lagerquist, Steve Mordue, and many more. Click here: DynamicsMinds Conference for more info on what is sure an amazing community conference covering all aspects of Power Platform and beyond.    Days of Knowledge Conference in Denmark - 1-2nd June 2023 Check out 'Days of Knowledge', a Directions 4 Partners conference on 1st-2nd June in Odense, Denmark, which focuses on educating employees, sharing knowledge and upgrading Business Central professionals. This fantastic two-day conference offers a combination of training sessions and workshops - all with Business Central and related products as the main topic. There's a great list of industry experts sharing their knowledge, including Iona V., Bert Verbeek, Liza Juhlin, Douglas Romão, Carolina Edvinsson, Kim Dalsgaard Christensen, Inga Sartauskaite, Peik Bech-Andersen, Shannon Mullins, James Crowter, Mona Borksted Nielsen, Renato Fajdiga, Vivian Voss, Sven Noomen, Paulien Buskens, Andri Már Helgason, Kayleen Hannigan, Freddy Kristiansen, Signe Agerbo, Luc van Vugt, and many more. If you want to meet industry experts, gain an advantage in the SMB-market, and acquire new knowledge about Microsoft Dynamics Business Central, click here Days of Knowledge Conference in Denmark to buy your ticket today!   COMMUNITY HIGHLIGHTS Check out our top Super and Community Users reaching new levels! These hardworking members are posting, answering questions, kudos, and providing top solutions in their communities.   Power Apps:  Super Users: @WarrenBelz, @LaurensM  @BCBuizer  Community Users:  @Amik@ @mmollet, @Cr1t    Power Automate:  Super Users: @Expiscornovus , @grantjenkins, @abm  Community Users: @Nived_Nambiar, @ManishSolanki    Power Virtual Agents:  Super Users: @Pstork1, @Expiscornovus  Community Users: @JoseA, @fernandosilva, @angerfire1213    Power Pages: Super Users: @ragavanrajan  Community Users: @Fubar, @Madhankumar_L,@gospa  LATEST COMMUNITY BLOG ARTICLES  Power Apps Community Blog  Power Automate Community Blog  Power Virtual Agents Community Blog  Power Pages Community Blog  Check out 'Using the Community' for more helpful tips and information:  Power Apps , Power Automate, Power Virtual Agents, Power Pages 

Announcing | Super Users - 2023 Season 1

Super Users – 2023 Season 1    We are excited to kick off the Power Users Super User Program for 2023 - Season 1.  The Power Platform Super Users have done an amazing job in keeping the Power Platform communities helpful, accurate and responsive. We would like to send these amazing folks a big THANK YOU for their efforts.      Super User Season 1 | Contributions July 1, 2022 – December 31, 2022  Super User Season 2 | Contributions January 1, 2023 – June 30, 2023    Curious what a Super User is? Super Users are especially active community members who are eager to help others with their community questions. There are 2 Super User seasons in a year, and we monitor the community for new potential Super Users at the end of each season. Super Users are recognized in the community with both a rank name and icon next to their username, and a seasonal badge on their profile.  Power Apps  Power Automate  Power Virtual Agents  Power Pages  Pstork1*  Pstork1*  Pstork1*  OliverRodrigues  BCBuizer  Expiscornovus*  Expiscornovus*  ragavanrajan  AhmedSalih  grantjenkins  renatoromao    Mira_Ghaly*  Mira_Ghaly*      Sundeep_Malik*  Sundeep_Malik*      SudeepGhatakNZ*  SudeepGhatakNZ*      StretchFredrik*  StretchFredrik*      365-Assist*  365-Assist*      cha_cha  ekarim2020      timl  Hardesh15      iAm_ManCat  annajhaveri      SebS  Rhiassuring      LaurensM  abm      TheRobRush  Ankesh_49      WiZey  lbendlin      Nogueira1306  Kaif_Siddique      victorcp  RobElliott      dpoggemann  srduval      SBax  CFernandes      Roverandom  schwibach      Akser  CraigStewart      PowerRanger  MichaelAnnis      subsguts  David_MA      EricRegnier  edgonzales      zmansuri  GeorgiosG      ChrisPiasecki  ryule      AmDev  fchopo      phipps0218  tom_riha      theapurva  takolota     Akash17  momlo     BCLS776  Shuvam-rpa     rampprakash  ScottShearer     Rusk  ChristianAbata     cchannon  Koen5     a33ik  Heartholme     AaronKnox  okeks      Matren  David_MA     Alex_10        Jeff_Thorpe        poweractivate        Ramole        DianaBirkelbach        DavidZoon        AJ_Z        PriyankaGeethik        BrianS        StalinPonnusamy        HamidBee        CNT        Anonymous_Hippo        Anchov        KeithAtherton        alaabitar        Tolu_Victor        KRider        sperry1625        IPC_ahaas      zuurg    rubin_boer   cwebb365   Dorrinda   G1124   Gabibalaban   Manan-Malhotra   jcfDaniel   WarrenBelz   Waegemma   drrickryp   GuidoPreite   metsshan    If an * is at the end of a user's name this means they are a Multi Super User, in more than one community. Please note this is not the final list, as we are pending a few acceptances.  Once they are received the list will be updated. 

Check out the new Power Platform Communities Front Door Experience!

We are excited to share the ‘Power Platform Communities Front Door’ experience with you!   Front Door brings together content from all the Power Platform communities into a single place for our community members, customers and low-code, no-code enthusiasts to learn, share and engage with peers, advocates, community program managers and our product team members. There are a host of features and new capabilities now available on Power Platform Communities Front Door to make content more discoverable for all power product community users which includes ForumsUser GroupsEventsCommunity highlightsCommunity by numbersLinks to all communities Users can see top discussions from across all the Power Platform communities and easily navigate to the latest or trending posts for further interaction. Additionally, they can filter to individual products as well.   Users can filter and browse the user group events from all power platform products with feature parity to existing community user group experience and added filtering capabilities.     Users can now explore user groups on the Power Platform Front Door landing page with capability to view all products in Power Platform.      Explore Power Platform Communities Front Door today. Visit Power Platform Community Front door to easily navigate to the different product communities, view a roll up of user groups, events and forums.

Microsoft Power Platform Conference | Registration Open | Oct. 3-5 2023

We are so excited to see you for the Microsoft Power Platform Conference in Las Vegas October 3-5 2023! But first, let's take a look back at some fun moments and the best community in tech from MPPC 2022 in Orlando, Florida.   Featuring guest speakers such as Charles Lamanna, Heather Cook, Julie Strauss, Nirav Shah, Ryan Cunningham, Sangya Singh, Stephen Siciliano, Hugo Bernier and many more.   Register today: https://www.powerplatformconf.com/   

Users online (2,550)