cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

Need help on AND expression

Can someone please combine this two expression with AND expression:

1-) contains(items('Apply_to_each_2')?['title'], triggerBody()?['repository']?['name'])

2-)contains(items('Apply_to_each_2')?['title'], triggerBody()?['issue']?['id'])

 

I tried  @and(contains(items('Apply_to_each_2')?['title'], triggerBody()?['repository']?['name']),contains(items('Apply_to_each_2')?['title'], triggerBody()?['issue']?['id']))  But it didn't work

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Need help on AND expression

Hi @Ramazan_BIYIK,

 

Could you please share a full screenshot of your flow's configuration?

Could you please show a bit more about these actions within the "Apply to each 2" action?

Further, could you please show more details about the erroe message?

 

I have made a test on my side and the issue is confiormed on my side. The error message shows up as below:18.JPG

 

The error message told that there is something wrong with the contains function. The contains function expects its two parameters matching following types:

contains(a dictionarya key (string))

contains(an arraya value (object))

contains(a stringa substring)

 

But the result the triggerBody()?['issue']?['id'] expression (Id dynamic content) returned is a Integer type, so the error occurs. Please take a try with the following formula within your Condition box and check if the issue is solved:

@and(contains(items('Apply_to_each')?['title'], triggerBody()?['repository']?['name']),contains(items('Apply_to_each')?['title'], string(triggerBody()?['issue']?['id'])))

I have made a test on my side and my flow's configuration as below:19.JPG

The flow works successfully as below:20.JPG

 

 

 

Best regards,

Kris

 

 

Community Support Team _ Kris Dai
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

5 REPLIES 5
Highlighted
Power Participant
Power Participant

Re: Need help on AND expression

Hi @Ramazan_BIYIK,

 

What is the message that you receive by Flow or Flow designer?

P.

Highlighted
Advocate II
Advocate II

Re: Need help on AND expression

Actually no message showed on compile. But showed on running. This is the error.Screenshot_37.png

I manage that error with changing the code with  @and(contains(items('Apply_to_each_2')?['title'], triggerBody()?['repository']?['name']),equals(items('Apply_to_each_2')?['title'], triggerBody()?['issue']?['id'])) . But this time it didn't work as ı expected.

 

 

Please check that picture. It works and what i am looking for. But 2 condition after and after make no sense. There must be a way to combine this 2 condition. 

 Screenshot_38.png

 

 

 

Highlighted
Community Support
Community Support

Re: Need help on AND expression

Hi @Ramazan_BIYIK,

 

Could you please share a full screenshot of your flow's configuration?

Could you please show a bit more about these actions within the "Apply to each 2" action?

Further, could you please show more details about the erroe message?

 

I have made a test on my side and the issue is confiormed on my side. The error message shows up as below:18.JPG

 

The error message told that there is something wrong with the contains function. The contains function expects its two parameters matching following types:

contains(a dictionarya key (string))

contains(an arraya value (object))

contains(a stringa substring)

 

But the result the triggerBody()?['issue']?['id'] expression (Id dynamic content) returned is a Integer type, so the error occurs. Please take a try with the following formula within your Condition box and check if the issue is solved:

@and(contains(items('Apply_to_each')?['title'], triggerBody()?['repository']?['name']),contains(items('Apply_to_each')?['title'], string(triggerBody()?['issue']?['id'])))

I have made a test on my side and my flow's configuration as below:19.JPG

The flow works successfully as below:20.JPG

 

 

 

Best regards,

Kris

 

 

Community Support Team _ Kris Dai
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
Advocate II
Advocate II

Re: Need help on AND expression

Thanks Kris for suggestion. Well explained. I later tried on different flow. I need to combine one string and one integer value with and expression. String values need  ' that. Like 'My_string value' but int don't. So the query should be like  """ my_database_column1 eq 'my_string_value' and my_database_column2 eq my_integer_value """

Highlighted
Advocate II
Advocate II

Re: Need help on AND expression

I had a similar problem needing multiple NOT Contains conditions and came up with the syntax below based on the helpful comments above.

 

@and(not(contains(item()?['DisplayName'], 'log')),not(contains(item()?['DisplayName'], 'marketing')),not(contains(item()?['DisplayName'], 'recei')),not(contains(item()?['DisplayName'], 'distribution')),not(contains(item()?['DisplayName'], 'financial')),not(contains(item()?['DisplayName'], 'invention')))

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Users online (8,412)