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 Apps / Lookup function with S...
Power Apps
Answered

Lookup function with Sharepoint that evaluate the same row

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I'm trying to write a lookup function to evaluate whether there are rows in my Sharepoint list that satisfy both conditions. When I write the function below, it returns the entries that satisfy either one of the conditions but not both:

LookUp('Log', (userID in 'Log'.Title && Text(Subtitle3_1) in 'Log'.ChallengeID),true)

The function above, which I in return use in a formula for Visible, returns true for entries where the user matches or the ChallengeID matches.

 

Is there a way for me to write a function to achieve my goal? 

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @byr10112 

    Always good to provide the levels of separation on the conditions.

    LookUp('Log', 
     (userID in 'Log'.Title) && 
     (Text(Subtitle3_1.Text) in 'Log'.ChallengeID),
     true
    )

    Also to make sure you are referring to a property of a control and not just the control itself (Subtitle3_1.Text).

     

    I hope this is helpful for you. 

  • byr10112 Profile Picture
    Microsoft Employee on at

    This didn't work. It's still returning true when it should be returning false. Below is the entire formula FYI:

    If(
    LookUp('Log',
    ((userID in 'Log'.Title)
    && (Text(Subtitle3_1.Text) in 'Log'.ChallengeID)),
    true),
    true, false)
  • Gerard Simpson Profile Picture
    2,987 Moderator on at

    @byr10112  - Just to chip in with something else here that may be of assistance, assuming my understanding is correct.

     

    If you are trying to identify rows where both these arguement resolve to true, would '=' work better instead of 'in'.

     

    By using in, you are checking the userID and your textinput against the entire columns in each side of the argument - which will resolve to true where that ID and textinput are present anywhere in the column.

  • Verified answer
    byr10112 Profile Picture
    Microsoft Employee on at

    When I removed the source info from the conditions it worked. Below is the final formula:

    If(
    LookUp('Log',
    ((userID in Title)
    && (Text(Subtitle3_1.Text) in ChallengeID)),
    true),
    true, false)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @byr10112 

    Sorry missed that you were trying to reference the whole table with the Log.'s

    You can get rid of all the redundant true false and If statement as well.  It is redundant to check if something is true and then return true.

    All you need is this:

    LookUp(Log, 
     (userID in Title) && 
     (Text(Subtitle3_1.Text) in ChallengeID),
     true
    )

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 Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard