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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Check for two elements...
Power Automate
Answered

Check for two elements in web page

(0) ShareShare
ReportReport
Posted on by 16

Hello!

 

So, at the moment PA desktop lacks directives for OR and AND. That can still be done (when checking for values on variables and things like that) by comparing everything on the first operand and then to "true" on the second one.

 

However, what if you need to check for two elements on the web page? I haven't been able to find how to build an expression sort of like

%Browser.Contains(UIElementButton0)%

or something like that.

 

Any workaround would be appreciated in any case.

 

Thanks in advance! 

I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @TPDBS 

    Not sure if I got your question correctly, but if you need something like %Browser.Contains(UIElementButton0)%, you can start with 'If web page contains' conditional and select the web element you want.

    Conditionals - Power Automate | Microsoft Docs

     

    To emulate 'AND' and 'OR', work with nested conditionals. For example:

    AND:

    1. 'If web page contains' element A

    2.     'If web page contains' element B

    3.          [Actions if true+true]

    4.     'End' if

    5. 'End' if

    OR:

    1. 'If web page contains' element A

    2.     Go to Actions  

    3. 'Else'

    4.     'If web page contains' element B

    5.          Go to Actions

    6.     'End' if

    7. 'End' if 

  • TPDBS Profile Picture
    16 on at

    Hi @Anonymous 

     

    Thank you for you answer. But yeah that's precisely what I'm trying to avoid. If you need to check 3 or 4 elements it becomes increasingly complicated.

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @TPDBS 

    I suggested working with nested If's statements because your original question mentions two elements.

    With more than 2 elements, an idea is using variables as flags and then compare those variables within Case/Switch options.

    For example, first you set the variables as result of existing elements:

    1. 'If web page contains' element A then

    2. 'Set variable' %FlagA% to 1

    3. 'End' if 

    4. 'If web page contains' element B then

    5. 'Set variable' %FlagB% to 1

    6. 'End' if

    7. 'If web page contains' element N then

    8. 'Set variable' %FlagN% to 1

    9. 'End' if

    and so on

    Then, concatenate these variables into a new one:

    10. 'Set variable' %Test% as %FlagA%%FlagB%%FlagN% (this gives you 111 or 101 for example)

    At last, use Switch/Case to define situations and actions:

    11. 'Switch', value to check= %Test%

    12. 'Case' =110

    13. (Your actions here)

    14. 'Case =101

    15. (Your actions here)

    ...    

     

  • TPDBS Profile Picture
    16 on at

    Hi @Anonymous! 

    Right, this is not ideal but it will work alright. Thank you!

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 410

#2
Vish WR Profile Picture

Vish WR 289

#3
David_MA Profile Picture

David_MA 282 Super User 2026 Season 1

Last 30 days Overall leaderboard