web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Trigger a flow to star...
Power Apps
Unanswered

Trigger a flow to start when a action is changed

(0) ShareShare
ReportReport
Posted on by

Hello,

I have a status field in CDS where it's possible to choose between for example "free", "reserved" and "booked". What I am doing now is that I am doing a flow so when a status is changed to "booked" I want it to send an e-mail by using the flow.

 

The trigger of the flow is "When a record is updated" and there I have put the status into attribute Filters BUT I only want it to send an e-mail when the status is changed to "booked" not when it is changed to either of the two others. 

 

I guess it has something to that I have to put something into "Switch to input entire array" within the Attribute Filter in the flow but I am not sure how I could do it...

 

Best regards,
Ina

I have the same question (0)
  • Hamish Sheild Profile Picture
    3,005 Most Valuable Professional on at

    Hi @Anonymous 

     

    Using the Common Data Service (current environment) connector you can use the Filter expression input to achieve this.

    Attached is an example of where I am filtering the trigger on the Account entity's Industry field changing to Accounting. i.e. the trigger only fires when I set the Industry field on an Account to the value of Accounting (which has an option set value of 1)

     

    Note: you need to have your Flow in a Solution to be able to use the Common Data Service (current environment) connector.

    -----
     
    If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

     

  • v-yutliu-msft Profile Picture
    on at

    Hi @Anonymous ,

    Do you want to trigger the flow only if when  status is changed to "booked"?

    Could you tell me the data type of  status field?
    I assume that it is an option set.

    Actually, you just need to add a condition to compare the option set's value.

    I've made a similar test for your reference:

    1)create a new option set named status:

    3272.PNG

     

    2)check the "booked" option's value, click "..."->view more.

    3273.PNG

     

    3)the flow:

    trigger "when a record is updated"

    condition: 

    fieldname(in my test the field name is also status)   is equal to 231670002

    //231670002 is my "booked" option's value, please replace it with your "booked" option value, remember to remove "," in it.

    yes:  action: send an email

    3274.PNG

     

    Then, only when you update the status to "booked", an email will be sent.

     

     

    Best regards,

     

  • Community Power Platform Member Profile Picture
    on at

    Hi @HSheild - Thank you for the reply,

     

    When I am about to create the trigger within the flow, that is "When a record is created, updated or deleted", there is no kind of dropdown that appears in the "Filtering attributes" and "Filter expression" fill ins which I think is quite strange. Cause the first time I created the trigger, the dropdown appeared but the only thing was that the value within the field did not show up in the "Filter expression" fill in so I decided to refresh the page and do it again. But from then the dropdowns have not been there and it doesn't make sense to write it in manually... Hope you understand what I mean

     

    Best regards,
    Ina

  • Hamish Sheild Profile Picture
    3,005 Most Valuable Professional on at

    Hi @Anonymous 

     

    The "Filtering attributes" and "Filter expression" fields are text fields which you need to type into.  I've never seen drop down options in them.  Understanding the text to type in can be tricky.  I use the XRMToolBox FetchXML Builder to create a query for the filter and then copy the OData 4.0 filter component of the query.  Here's a quick screenshot.

     

    Annotation 2020-03-26 11082013.png

     

    Alternatively, you could do what @v-yutliu-msft suggests which is slightly easier but it means that your Flow will trigger for every value in your optionset which could be inefficient and use up your Flow run quota.

     

    -----
     
    If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

  • Community Power Platform Member Profile Picture
    on at

    Hi @HSheild,

     

    I downloaded the XrmToolBox and When I'm about to select a connection method for the Fetch XMLBuilder I chose "Connection String" (as I think I have to chose that since I am connecting it to an entity) and there I am not sure what to do... I found this example on the internet:

     

    <connectionStrings>
       
    <add name="MyCRMServer" connectionString="AuthType=AD;Url=http://contoso:8080/Test;" />
    </connectionStrings>

     

    I guess I can keep the name just as I want it to be but the connection string I am not sure about...

     

    Best regards,
    Ina

  • Hamish Sheild Profile Picture
    3,005 Most Valuable Professional on at
    Hi @Anonymous

    Use the connection wizard in XRMToolbox, it is a lot easier

    https://www.xrmtoolbox.com/documentation/for-users/connecting-to-an-organization/
  • v-yutliu-msft Profile Picture
    on at

    Hi @Anonymous ,

    Do you mean that you can not find the field dynamic value in condition's filter query?

    That's really strange.

    Could you tell me what is this field's data type that with these values:  "free", "reserved" and "booked"?

    I suggest you set it as an option set field.

    1)a create a custom option set as the screen shoots that I posted

    2)insert a field in your entity, set its data type to option set and choose the option set that you just created

    331.PNG

     

    3)create flow

    please choose the environment that the entity that you want to edit belongs to, choose the entity name that the option set field belongs to, choose scope that you want(I choose business unit as example)

    After you choose data in trigger, add a condition, in the condition's first parameter, the field names in that entity will show for you selecting.

    You just need to select status field that you just created.

    3312.PNG

     

    Then finish the flow as I mentioned.

     

     

    Best regards,

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard