cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

How to start a list workflow only when a list field is not empty?

I have a list based workflow. I am trying to trigger this workflow only when a field is NOT empty. I understand that I can add a trigger condition to "When an item is created or modified" similar to the following:

 

@not(contains(triggerBody()?['Resolution']?['Value'], null))

 

But I get the following error when I do so:

 

InvalidTemplate. Unable to process template language expressions for trigger 'When_an_item_is_created_or_modified' at line '1' and column '4720': 'The template language function 'contains' expects parameters of matching types: a dictionary and a key (string), an array and a value (object), or a string and a substring. The provided types 'String' and 'Null' are incompatible. Please see https://aka.ms/logicexpressions#contains for usage details.'.

 

Any suggestions?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: How to start a list workflow only when a list field is not empty?

 

Hi @sranacdw ,

 

Please try to use empty() function to check if the field is empty.

@equals(empty(triggerBody()?['Resolution']?['Value']), false)

 

Best Regards, 

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: How to start a list workflow only when a list field is not empty?

 

Hi @sranacdw ,

 

Please try to use empty() function to check if the field is empty.

@equals(empty(triggerBody()?['Resolution']?['Value']), false)

 

Best Regards, 

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Frequent Visitor

Re: How to start a list workflow only when a list field is not empty?

Will try and post my update here

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (7,235)