Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Text Label not updating based on a Lookup value from a value in a Dropdown list

Posted on by 49
Hi Everyone,
 
Please reference the screenshot below - I have a Label that uses the Lookup code:
LookUp(APVEN, VENDNAME = VendorList.Selected.VENDNAME, VENDORID)
APVEN is the Excel Table in Sharepoint that is connected. VendorList is the Controlbox Name for the Dropdown list. VENDNAME is the field that the Dropdown list is pulling values from in the Excel table, and VENDORID is the value that I am trying to show in the label. For some reason it is just showing up Blank. Any ideas on what I could be doing wrong? The field names match the header values in the Excel file and I'm not getting any errors in the Power App screen.
 
  • Verified answer
    MM-07112006-0 Profile Picture
    MM-07112006-0 49 on at
    Text Label not updating based on a Lookup value from a value in a Dropdown list
    Hi,
     
    So I have 3 debugging labels:
     
    First one is Text = VendorList.Selected.VENDNAME
    - This returns the correct text value that was selected in the Dropdown, in this case "1-800-Got-Junk?                                             "
     
    Second one is Text = LookUp(APVEN, VENDNAME = VendorList.Selected.VENDNAME, VENDORID)
    - This returns a blank value.
     
    Third one is Text = LookUp(APVEN, VENDNAME = "1-800-Got-Junk?", VENDORID)
    - This returns the expected value from the VENDORID field.
     
     
    Yes, those are spaces after the first Text debugger. So I tried this function and IT WORKS!!!! YAY. 
    LookUp(APVEN, VENDNAME = TrimEnds(VendorList.Selected.VENDNAME), VENDORID)
  • ronaldwalcott Profile Picture
    ronaldwalcott 1,167 on at
    Text Label not updating based on a Lookup value from a value in a Dropdown list
    Just realizing that this a SharePoint list and an Excel spreadsheet.
    Are you getting the vendor name from the spreadsheet and storing it in a column in the SharePoint list?
    If so, instead of using selected perform the lookup using the datacard value of the column for the vendor name.

    LookUp(APVEN, VENDNAME = thedatacardvalueforvendorname, VENDORID)
  • ronaldwalcott Profile Picture
    ronaldwalcott 1,167 on at
    Text Label not updating based on a Lookup value from a value in a Dropdown list
     
     
  • MM-07112006-0 Profile Picture
    MM-07112006-0 49 on at
    Text Label not updating based on a Lookup value from a value in a Dropdown list
    The table range is properly defined.
  • ronaldwalcott Profile Picture
    ronaldwalcott 1,167 on at
    Text Label not updating based on a Lookup value from a value in a Dropdown list
    Check the Excel spreadsheet to make sure that the table range is still properly defined
  • MM-07112006-0 Profile Picture
    MM-07112006-0 49 on at
    Text Label not updating based on a Lookup value from a value in a Dropdown list
     
    Ok timl, when I type 
    LookUp(APVEN, VENDNAME = "Caret Consulting Inc.", VENDORID)
    I am getting the return value of VENDORID!
     
    I also noticed when I select a value in my Dropdown List, even though it displays the name in the box, it is saying the value is null?
     
    When I submit my app, I was able to see the Vendor Name when I typed it in, but when I changed it to a Dropdown list, even after I select a vendor, the value during my approval flow shows up blank too.
     
    I think we are getting close.... any ideas why it showing "null" even when a value was selected from the dropdown?
     
  • ronaldwalcott Profile Picture
    ronaldwalcott 1,167 on at
    Text Label not updating based on a Lookup value from a value in a Dropdown list
    I really don't know what else it could be. 
    What did monitor show?
    Are the fields, for these columns, in Excel all defined as text?
    Does the ID value in the Excel table look properly formed?
    How many columns are in the Excel table, does it have duplicated rows?
     
     
  • timl Profile Picture
    timl 32,058 on at
    Text Label not updating based on a Lookup value from a value in a Dropdown list
    To diagnose this further, could you set the Text of the label that you're using to this? Can you confirm that this returns the name of the selected item in the dropdown box?
     
    VendorList.Selected.VENDNAME
     
    Next, can you try hardcoding the name in the call to lookup to see if that returns the correct value?
    LookUp(APVEN, VENDNAME = "Caret Consulting Inc.", VENDORID)
    

     
    If that returns blank, can you confirm that the condition does return a row by calling CountIf? This should hopefully return a value of 1 if there's a matching record.
    CountIf(APVEN, VENDNAME = "Caret Consulting Inc.")
    
     
  • MM-07112006-0 Profile Picture
    MM-07112006-0 49 on at
    Text Label not updating based on a Lookup value from a value in a Dropdown list
    Ok I tried both of those suggestions:
     
    When I enter First(APVEN).VENDORID it does indeed return the value from VENDORID from the Excel table.
     
    I also tried the TRIM function to trim the spaces, but that returns a blank value as it did before, so I don't think that is it.

    I also took a screenshot when highlighting the Supplier Name dropbox, clicking Items and expanding the APVEN dialogue box. I don't see the leading columns that are in the far left of the Excel table, not sure why or if this has anything to do with why it isn't working?

  • timl Profile Picture
    timl 32,058 on at
    Text Label not updating based on a Lookup value from a value in a Dropdown list
    Hi  MM-07112006-0 
     
    If the cause of this is trailing spaces, you could try the following to trim the spaces. 
    LookUp(APVEN, Trim(VENDNAME) = Trim(VendorList.Selected.VENDNAME), VENDORID)
     

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,591

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,090

Leaderboard