cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bron
Helper I
Helper I

Trigger Condition for Choice field not working

Hello all,

 

I am hoping someone can help me. I have set up a flow based on whether a choice field is changed or not but I am getting an error message. Here is the scenario:

 

We have set up our Tenders Register in Sharepoint Lists. One of the fields is a choice field called BID STATUS which has five choices ('Go', 'No Go', 'Pending', 'Won', 'Lost', or 'Submitted'). I would like the flow to trigger only if the value of the BID STATUS field is changed to either 'Won' or 'Lost'.

 

Here is what I have so far:

 

Trigger Condition 01.jpgTrigger Condition 02.jpg

 

The Flow Checker is giving me the following error:

 

When an Item or File is Modified (1)

Fix invalid expression(s) for the input parameter(s) of operation 'When_an_item_or_file_is_modified'.

 

I am assuming it is something to do with the trigger conditions as I am not sure if I have used the correct syntax. In case you can't see it properly in the JPG, here is what it says:

 

@or(equals(triggerOutputs()?['body/Bid_x0020_Status/Value'], 'Won', equals(triggerOutputs()?['body/Bid_x0020_Status/Value'], 'Lost'))

 

 

Any help would be much appreciated.

 

Regards,

Bron

3 ACCEPTED SOLUTIONS

Accepted Solutions
v-duann-msft
Community Support
Community Support

Hi @Bron 

 

Thanks for your posting.

 

Accordingly to your requirement, you would like to filter data based on two conditions (BIDSTATUS = Won or BIDSTATUS = Lost) and currently stuck in expression part.

 

If you don’t mind, I would like to help you simply your flow without fx and achieve same purpose.

 

Here is my test SPO list:

v-duann-msft_0-1611300060863.png

 

 

Please kindly change condition area as we can add multi-conditions at the same time :

v-duann-msft_1-1611300060869.png

 

 

When I tried to add won/lost records in list, I got required email notifications with success.

v-duann-msft_2-1611300060871.png

 

 

Hope the information above may help you.

 

Thanks

Anna

View solution in original post

v-duann-msft
Community Support
Community Support

Hi @Bron 

 

Thank you very much for your reply.

 

Based on your queries , here are the answers for your reference:

 

1.How do I change the condition to an OR condition?

You can simply click on ‘Add’ bottom and select ‘And row’.

v-duann-msft_0-1611733863004.png

 

 

After that, you will be able to see ‘And’/‘Or’ option and set up secondary condition.

v-duann-msft_1-1611733863006.png

 

2.Once I have done that, do I need to remove the Trigger condition from When an item or file is modified?

Whether you remove trigger condition or not, it doesn’t matter.

 

If you keep the trigger condition, when status shows any other options, the flow won’t start at the beginning. 

If you remove the trigger condition, when status shows any options, the flow goes as normal and navigate to No branch then fails at last. So based on the result, It makes almost no difference.

 

3.Also, depending on whether the status is LOST or WON, the email needs to go to a different set of people, and contain different information. I don't know if that would require changes to your solution or not.

Currently I know nothing about your result email. I couldn’t tell you that there is absolutely no part that needs to be modified if there are totally different styles for two emails. If you like, you can share me a sample about email.

 

By the way, the correct fx in your trigger condition should be as below(Seems you missed the Closing bracket. If you are worried about following issues, you can just change fx):

@or(equals(triggerOutputs()?['body/Bid_x0020_Status/Value'], 'Won'), equals(triggerOutputs()?['body/Bid_x0020_Status/Value'], 'Lost'))

 

v-duann-msft_2-1611733863011.png

 

 

v-duann-msft_3-1611733863015.png

 

Hope the content above may help you.

 

Thanks

Anna

View solution in original post

Thank you for your help Anna. I have made the changes, and will let you know if it works once it is tested.

 

Regards,

Bron

View solution in original post

6 REPLIES 6
v-duann-msft
Community Support
Community Support

Hi @Bron 

 

Thanks for your posting.

 

Accordingly to your requirement, you would like to filter data based on two conditions (BIDSTATUS = Won or BIDSTATUS = Lost) and currently stuck in expression part.

 

If you don’t mind, I would like to help you simply your flow without fx and achieve same purpose.

 

Here is my test SPO list:

v-duann-msft_0-1611300060863.png

 

 

Please kindly change condition area as we can add multi-conditions at the same time :

v-duann-msft_1-1611300060869.png

 

 

When I tried to add won/lost records in list, I got required email notifications with success.

v-duann-msft_2-1611300060871.png

 

 

Hope the information above may help you.

 

Thanks

Anna

Hi Anna,

 

Thank you for responding. A couple of questions:

 

  1. How do I change the condition to an OR condition?
  2. Once I have done that, do I need to remove the Trigger condition from When an item or file is modified?

Regards,

Bron

Also, depending on whether the status is LOST or WON, the email needs to go to a different set of people, and contain different information. I don't know if that would require changes to your solution or not.

 

Regards,

Bron

v-duann-msft
Community Support
Community Support

Hi @Bron 

 

Thank you very much for your reply.

 

Based on your queries , here are the answers for your reference:

 

1.How do I change the condition to an OR condition?

You can simply click on ‘Add’ bottom and select ‘And row’.

v-duann-msft_0-1611733863004.png

 

 

After that, you will be able to see ‘And’/‘Or’ option and set up secondary condition.

v-duann-msft_1-1611733863006.png

 

2.Once I have done that, do I need to remove the Trigger condition from When an item or file is modified?

Whether you remove trigger condition or not, it doesn’t matter.

 

If you keep the trigger condition, when status shows any other options, the flow won’t start at the beginning. 

If you remove the trigger condition, when status shows any options, the flow goes as normal and navigate to No branch then fails at last. So based on the result, It makes almost no difference.

 

3.Also, depending on whether the status is LOST or WON, the email needs to go to a different set of people, and contain different information. I don't know if that would require changes to your solution or not.

Currently I know nothing about your result email. I couldn’t tell you that there is absolutely no part that needs to be modified if there are totally different styles for two emails. If you like, you can share me a sample about email.

 

By the way, the correct fx in your trigger condition should be as below(Seems you missed the Closing bracket. If you are worried about following issues, you can just change fx):

@or(equals(triggerOutputs()?['body/Bid_x0020_Status/Value'], 'Won'), equals(triggerOutputs()?['body/Bid_x0020_Status/Value'], 'Lost'))

 

v-duann-msft_2-1611733863011.png

 

 

v-duann-msft_3-1611733863015.png

 

Hope the content above may help you.

 

Thanks

Anna

Thank you for your help Anna. I have made the changes, and will let you know if it works once it is tested.

 

Regards,

Bron

Hello Ana, 

 

I do the same but when I complete another column, I receive again the mail. I don't know why. I think that this is because the system read again the information.

 

Could you help me ?

 

Have a good day.

 

Vincent.

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.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,369)