cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Array Filter NOT ends with

What should be the operator/syntax if I want to filter out something that does NOT ends with certain value. I tried @doesnotend,

not(endswith.. ) But I am always getting errors that the query is invalid. Basically I want to opposite of result of @endswith(item()?['{VersionNumber}'], '.0')

1 ACCEPTED SOLUTION

Accepted Solutions
VictorIvanidze
Community Champion
Community Champion

Use 

@not(endsWith(item()?['VersionNumber'], '.0'))

If you get an error show it here please.

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

View solution in original post

5 REPLIES 5
VictorIvanidze
Community Champion
Community Champion

Use 

@not(endsWith(item()?['VersionNumber'], '.0'))

If you get an error show it here please.

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.
Anonymous
Not applicable

I tried what you suggested but got the following error

The execution of template action 'Filter_array' failed: The evaluation of 'query' action 'where' expression '@not(endsWith(item()?['VersionNumber'], '.0'))' failed: 'The template language function 'endsWith' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#endswith for usage details.'.
VictorIvanidze
Community Champion
Community Champion

Use this:

 

if(empty(item()?['VersionNumber']),false,not(endsWith(item()?['VersionNumber'], '.0')))

 

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.
Anonymous
Not applicable

Hello again, this time I wasn't able to save the expression the error was 

Flow save failed with code 'WorkflowRunActionInputsInvalidProperty' and message 'The 'inputs' of workflow run action 'Filter_array' of type 'Query' is not valid. Property 'where' must be a template language expression.'.
Anonymous
Not applicable

So It turns out that your initial suggestion was almost right, that's why I marked it as solution. We were missing the {}

@not(endsWith(item()?['VersionNumber'], '.0'))

@not(endswith(item()?['{VersionNumber}'], '.0'))

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (3,297)