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 / Compare a variable if ...
Power Automate
Answered

Compare a variable if it is presence in a list

(0) ShareShare
ReportReport
Posted on by 8

Hi 
I would like to find out how could I compare a variable if it is presence in a list. 

Thanks for your help.

 

I have the same question (0)
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Hello,

     

    You can do an IF statement that checks whether the list contains the variable. This will expect an exact match.

    Assuming your list is in %List% and your variable is in %NewVar%, you can paste the following code to PAD for the comparison:

    IF Contains(List, NewVar, False) THEN
     #Do something here
    END

     

    If you feel like I solved your problem, please mark my answer as the solution.

     

    Thank you.

  • winfs Profile Picture
    8 on at

    Thanks.
    I am a total beginner. How do I paste the code? In PAD, I can drag and drop the If action but could not paste the code.   

  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Copy the code from here and when you have your designer open, simply send Ctrl+V. It's that simple.

    PAD accepts code written in this language (Robin) and converts that to actions. You can also do the opposite and copy the actions out of PAD to a text editor like Notepad to see the code behind it.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 796

#2
Valantis Profile Picture

Valantis 568

#3
Haque Profile Picture

Haque 538

Last 30 days Overall leaderboard