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 / 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:
  • 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

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 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard