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

I have the same question (0)
  • 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

Forum hierarchy changes are complete!

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

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard