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 Apps / Button That Searches S...
Power Apps
Unanswered

Button That Searches SharePoint List for Unique Value and then returns a cell value on the same row but different column

(0) ShareShare
ReportReport
Posted on by

Hello,

 

Further to my previous post, decided to move away from Excel into SharePoint Lists. Have built a button that patches data from Power Apps into this SharePoint. However can't figure out a way to search this list for a unique field and then return a value that's on the same row, but different column. Tried Collections and converting them to text. Currently my code is:

 

DOB.Value = LookUp('My SharePoint List','Surname' = surname.Value,'Date of Birth')
 
DOB.Value is my TextInput on Power Apps,
Surname is unique column in SharePoint,
surname.value is from my Power Apps,
Date of Birth is what I wish to be return and placed into DOB.Value,
 
Have linked the SharePoint in Power Apps. Have issue with variable types, but all fields are set as text. 
 
Any help, thank you. 
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    Hi @David_Howarth ,

    Assuming both Surname and 'Date of Birth' are Single Line of Text fields in your SP List, what type of control is surname ?

  • David_Howarth Profile Picture
    on at

    Thanks for your help

     

    Double-checked and Surname & Date of Birth are single line of text.

     

    surname is Text Input - Mode Single Line

  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    @David_Howarth ,

    Are you using the same case in the Text input (smith does not equal Smith). You are probably better doing this

    LookUp(
     'My SharePoint List',
     StartsWith(
     'Surname',
     surname.Value
     )
    ).'Date of Birth'

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • David_Howarth Profile Picture
    on at

    all text is lower case as after reading more about cases will improve the search to look for upper and lower.

     

    Tried you code and didn't return anything from the SharePoint list.

     

    DOB.Value = LookUp('MySharePointList', StartsWith('Surname', suranme.Value)).'Date of Birth'

     

    Thanks for the suggestion will look into the help videos about storing locally.

     

    Could I buy you a coffee for your time?

     

     
  • David_Howarth Profile Picture
    on at

    As new to Power Apps, used the Set and Notify function to test what feedback I got from your suggestion and I do get the Date of Birth from the SharePoint List. So thank you for your code suggest. 

    The bump in the road is getting this result to appear in the DOB.Value text input box

     

    Have tired the variable name show in the Notify function to set DOB.Value= variablename 

  • Verified answer
    WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    @David_Howarth ,

    Based on what you posted (which is all I can respond to) assuming Surname and 'Date of Birth' are Single Line of Text fields and surname is (I assume a modern) Text input, then this code is correct and will return a Text value for 'Date of Birth'

    LookUp(
     'My SharePoint List',
     StartsWith(
     'Surname',
     surname.Value
     )
    ).'Date of Birth'

    Try a Classic Text Input (the output will be .Text, not .Value )

     

  • David_Howarth Profile Picture
    on at

    Thank you for your time and patience with this. I need to have a classic text input box and set its default value to the variable where I store the returned field. Whilst it will load to an empty text input, it won't replace already existing text. I'm happy to look into this. Thank you for the spring board

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard