web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Need help on AND expre...
Power Automate
Answered

Need help on AND expression

(0) ShareShare
ReportReport
Posted on by 49

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

Categories:
I have the same question (0)
  • vecerpa Profile Picture
    786 on at

    Hi @Ramazan_BIYIK,

     

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

    P.

  • Ramazan_BIYIK Profile Picture
    49 on at

    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

     

     

     

  • Verified answer
    v-xida-msft Profile Picture
    on at

    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

     

     

  • Ramazan_BIYIK Profile Picture
    49 on at

    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 """

  • 980Panama Profile Picture
    140 on at

    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')))

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 398 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 323 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 183 Most Valuable Professional

Last 30 days Overall leaderboard