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 / If Equal to Vs Contain...
Power Automate
Answered

If Equal to Vs Contains...

(0) ShareShare
ReportReport
Posted on by

Hmmm...

 

The %Matches% result = Ebay

The %Ebay% var value = Ebay

Doesnt work when "equal to" but does work when set to "contains"... ?

Also doesnt work when hardcoded "Ebay" is in the second operand (in the If).

Thoughts...

 

Screenshot 2022-02-16 203524.png

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Do you have white space in one of those variables, such as "ebay{space}" or "{space}ebay"?

  • UK_Mike Profile Picture
    on at

    Hey Mike, no pal, triple checked everything.

    Im wondering if im getting the match result with a space after.

    As in result = Ebayspace

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    That's what I was asking.  If so, Trim Text (white spaces from beginning and end) and try that.

  • UK_Mike Profile Picture
    on at

    I thought you meant my var rather than the output var.

    Ive just trimmed the resulting match, beginning and end, no joy...

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Are they both Text Variables?  Or is 1 a List?

  • UK_Mike Profile Picture
    on at

    Set Ebay to %Ebay% is the first var.

    The %matches% is produced from the Parse Text action.

    No lists...

     

     

  • UK_Mike Profile Picture
    on at

    Output from the %Matches% 

     

     

    Screenshot 2022-02-16 211034.png

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Yup, it's a List, so you need %Matches[0]%.

  • Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at

    Wouldn't the following code yield the desired result with less effort?

    IF Contains(ExtractedPDFText, $'''@ebay.''', True) THEN
     Display.ShowMessageDialog.ShowMessage Message: $'''The PDF contains an ebay email address!!!''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False
    END

     

     

  • UK_Mike Profile Picture
    on at

    Dagnabit !!! Genuinely thought it would just pull the output rather than having to specify the index 🙄

    Im still stumped why it matched contains but not equal to, as I didnt specify the index ? Could you explain why ?

     

    So, as every result will be at 0 index therefore I just have to set print to %Matches[0]%, I can live with that.

     

    Thanks 😀

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 227 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 213 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 151

Last 30 days Overall leaderboard