MSDN Community

Trouble with Power Automate Trigger Conditions

Hello everyone,

I'm encountering an issue with trigger conditions in Power Automate. I have a flow that's supposed to trigger when a new item is created in a SharePoint list, but only if a specific column (let's call it 'Status') is set to 'Approved'.

Here's the expression I'm using for the trigger condition:

@equals(triggerBody()?['Status']?['Value'], 'Approved')
                

However, the flow seems to be triggering even when the 'Status' is set to something else, like 'Pending' or 'Rejected'. It's also not triggering when it *is* set to 'Approved' sometimes. It's quite inconsistent.

Has anyone faced a similar problem or can suggest what might be wrong with my condition?

Thanks in advance!

Reply Mark as helpful Report

Hi JohnDoe123,

I've seen this behavior before. The issue might be how SharePoint list column values are returned. For choice fields, it often returns an object with a 'Value' property. Your current expression looks correct for that.

However, sometimes the trigger body can be a bit unpredictable, especially with custom columns or complex data types.

Try this modified expression. It adds a check to ensure the 'Status' property exists and is an object before trying to access its 'Value':

@and(
    not(empty(triggerBody()?['Status'])),
    isType(triggerBody()?['Status'], 'Object'),
    equals(triggerBody()?['Status']?['Value'], 'Approved')
)
                

Also, ensure that the column name 'Status' is exactly matching the internal name in SharePoint. You can check this by going to your SharePoint list settings, clicking on the column, and looking at the URL. The internal name is usually after 'Field='. For example, `Field=YourInternalColumnName`.

Let me know if this helps!

Reply Mark as helpful Report

Alice_PowerUser, thank you so much!

I tried your first suggestion with the `and(not(empty(...)))` and `isType()` check. It seems to have resolved the inconsistency! The flow is now triggering correctly when the 'Status' is 'Approved' and not triggering otherwise. I also double-checked the internal name of the column, and it was correct.

It's amazing how a small check can make such a difference. I appreciate you pointing me in the right direction.

Reply Mark as helpful Report

Post a reply