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 / Simple SharePoint list...
Power Apps
Answered

Simple SharePoint list lookup not working

(0) ShareShare
ReportReport
Posted on by 20

Hi, I'm not sure why this is causing me so much trouble and I'm hoping someone can help.

 

I have a list box called store_num_selection which is populated with store numbers, e.g. 123, 456, 789. Those numbers match numbers that exist in a SharePoint list called tbl_store, in the field store_num.

 

When a value is selected in the list box I need a label field to be populated with the store name, which is stored in tbl_store in field store_name, alongside the store_num field.

 

I have tried multiple search, lookup, filter options and nothing is working. I'm a newbie so any advice you can offer would be gratefully received.

 

Thanks, Jon

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    In the Text property of your Label, you should try this: 

     

    Lookup(tbl_store, store_num=store_num_selection.Selected.Value, store_name)

     

    Or this, both are equivalent. 

     

    Lookup(tbl_store, store_num=store_num_selection.Selected.Value).store_name

     

     https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-filter-lookup

     

    However, with this, the label will only show the name of the store corresponding to last store_num value selected in the List box.

     

    Is that what you want when more than one value is selected in the list box? What is the desired outcome?

    If you only want the user to be able to select one value, maybe you can try drop down instead. The formula would stay the same with a drop down. 

  • mdevaney Profile Picture
    29,993 Moderator on at

    @jonlake
    Put this code in your label replacing my List and Column names with your own.

    LookUp(your_stores_list, StoreNumberColumn = ListBox.Selected.Value, StoreNameColumn)

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • jonlake Profile Picture
    20 on at

    Hi, I have changed from a list box to a drop-down, but I'me getting an invalid argument error when using the equals symbol. Is it because it's not a delegateable function in SharePoint? Please excuse me if I'm using the incorrect terminology.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I think it is happening because the type of numbers in your drop down and sharepoint list store_num field do not match. Make sure that the drop down items are of the same type as store_num. 

     

    If the store_num is integer then:

     

    [123, 456, 789]

     

    If the store_num is string then: 

    ["123", "456", "789"]

    The types need to match on both sides of the equation. 

  • mdevaney Profile Picture
    29,993 Moderator on at

    @jonlake 

    Please share the code you used and a screenshot of your app with the error.  I also want to know, what type of column is store number?  what about store name?

     

     

  • jonlake Profile Picture
    20 on at

    The store numbers in the SharePoint list tbl_store are formatted as numbers. The drop down is populated using a distinct filter, matching the user to items in a table called tbl_sharepoint_partner_store_relationships. Here is the distinct filter which populates the drop-down:

     

    Sort(Distinct(Filter(tbl_sharepoint_partner_store_relationships,email = user_email.Text),store_num),Result,Ascending)

     

    I guess it's populating the store numbers as text, so can I somehow force the format to be a number?

  • mdevaney Profile Picture
    29,993 Moderator on at

    @jonlake 
    Maybe like this.

    LookUp(your_stores_list, StoreNumberColumn = Value(ListBox.Selected.Value), StoreNameColumn)

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

  • jonlake Profile Picture
    20 on at

    Here is an image of the drop-down formula:

     

    image.png

    Here is the error image for the label:

    image (1).png

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Try 

    store_num_selection.Selected.Value
  • mdevaney Profile Picture
    29,993 Moderator on at

    @jonlake 
    Looks like you did something different from what I suggested above.

     

    Don't use store_num_selection.SelectedText.  Use store_num_selection.Selected.Value.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 130

Last 30 days Overall leaderboard