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 / HELP on LOOKUP Function
Power Apps
Unanswered

HELP on LOOKUP Function

(0) ShareShare
ReportReport
Posted on by 47

Hi,

 

I have a excel sheet with Table 1 with column name 'Project Code'. In the PowerApp i have a dropdown selection box name as Dropdown1 and I just want to return the email address in the text input box.

 

On the text input box, I written the formula as LookUp(Table1,'Project Code'=Dropdown1.Selected.'Project Code', 'Project Manager Email').

 

There is a syntax error as shown below:

jeremyncs_0-1691737336529.png

Please advice how to resolve the above issue. Is my formula written wrongly? Appreciate someone out

Categories:
I have the same question (0)
  • gcmfaizan Profile Picture
    1,022 on at

    Hi @jeremyncs ,

     

    can you try this formula on Dropdown1 OnChange propert with UpdateContext function like:


     

     UpdateContext({varProjectManagerEmail: LookUp(Table1, 'Project Code' = Dropdown1.Selected.'Project Code', 'Project Manager Email')
    })

     

    Then in the text box Text property use variable varProjectManagerEmail to display the value.


     

    Please mark my post as a solution to help others. 

     

    Cheers!

     

  • jeremyncs Profile Picture
    47 on at

    Hi,

     

    Thanks for your advice!

     

    I did that. I still received the same syntax error. I placed the variable varProjectManagerEmail on the textbox as shown below. 

    jeremyncs_0-1691740223046.png

    Did I do it wrongly?

     

  • gcmfaizan Profile Picture
    1,022 on at

    Can you show me the screenshot of this variable from the left menu by clicking the {x} icon and then opening this variable in view mode?

  • jeremyncs Profile Picture
    47 on at

    jeremyncs_0-1691740807188.pngjeremyncs_1-1691740938245.png

    This is the syntax error.

  • gcmfaizan Profile Picture
    1,022 on at

    Can you confirm the column type of the Primary Project Manager Email? 


    More ever can you wrap varProjectManagerEmail in Text function like:


     

     Text(varProjectManagerEmail) 

     

  • gcmfaizan Profile Picture
    1,022 on at

    Ok I got it,

    onChange property of drop-down use the formula like this:

     

     

     UpdateContext({varDDSelected: Dropdown1.Selected.'Project Code''}); UpdateContext({varProjectManagerEmail: LookUp(Table1, 'Project Code' = Value(varDDSelected), 'Project Manager Email')
    })

     

     

    firstly, try the above code if it works that's great. if not try this formula:

     

     

     UpdateContext({varDDSelected: Dropdown1.Selected.'Project Code''}); UpdateContext({varProjectManagerEmail: LookUp(Table1, 'Project Code' = Text(varDDSelected), 'Project Manager Email')
    })

     

    Then in the text box Text property use the variable varProjectManagerEmail to display the value.

     

    I'm very hopeful now it works.
    And please mark my posts as the solution. to help comunity.

     

     

     

  • jeremyncs Profile Picture
    47 on at

    Hi, thanks for your advice. Over the weekend, I try to change the variable name on the excel from Project Code to Project_Code and Project Manager Email to Project_Manager_Email. 

     

    I used back your original syntax and modified based on the new variable name: 

     UpdateContext({varProjectManagerEmail: LookUp(Table1, Project_Code = Dropdown1.Selected.Project_ Code, Project_Manager_Email)
    })

    Now is working as it was expected.

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard