Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

lookup() issues with dynamic values

(0) ShareShare
ReportReport
Posted on by 216 Super User 2025 Season 1

Having some problems with lookup() function when trying to build a multi-language supported App.  I have a data source that has 3 columns, Title, English, and French.  When I change the user language from French to English or vice versa I am seeing the desired results.  See examples below.

 

The following code will return just "English" or "French", into the text label.

 

 

LookUp(
 Table2, 
 Text(Dropdown1.Selected.Value) = Text(Column1), 
 varUserLanguage
)

 

 

 

Where this code, returns the proper message or title text from the datasource

 

 

LookUp(
 Table2, 
 Text(Dropdown1.Selected.Value) = Text(Column1), 
 English 
)

 

 

 Yes, I have tried wrapping the varUSerLanguage in Text().

 

I am sure this is a super simple thing I am not seeing.

Categories:
  • LaurensM Profile Picture
    12,510 Super User 2025 Season 1 on at
    Re: lookup() issues with dynamic values

    @Hack-7,

     

    I would recommend 1 collection with a field to indicate the language. This allows you to reference a simple & short LookUp function (without If / Switch statements). Additionally, this approach is easily scalable with a third language by just adding records (no need to create an additional collection).

     

    One thing to take into account is that using 1 collection expects the list length to not exceed your Data Row Limit (Max 2000 records). Otherwise you may need a workaround to create collections that exceed 2000 records.

     

    I hope this helps!

  • Hack-7 Profile Picture
    216 Super User 2025 Season 1 on at
    Re: lookup() issues with dynamic values

    @LaurensM 

     

    Thanks for the notes, I did not realize lookup() did not support dynamic references. 

     

    As a follow-up question.  Would you suggest I build two collections?  One for each language? Or just build a single one that references a language field?  Does it make a difference?

     

    Cheers

  • Verified answer
    LaurensM Profile Picture
    12,510 Super User 2025 Season 1 on at
    Re: lookup() issues with dynamic values

    Hi @Hack-7,

     

    Dynamic column references are currently not supported within Power Apps. A workaround would be using a Switch statement:

    With(
     {
     wRecord: LookUp(
     Table2, 
     Dropdown1.Selected.Value = Column1
     )
     },
     Switch(
     varUserLanguage,
     "English",
     wRecord.English,
     "French",
     wRecord.French
     )
    )

     

    This will make the code rather long. What I would recommend is using a record for each language instead of 1 record with 2 language columns:

     

    Title Language Translation
    Title 1 English English value
    Title 1 French French value

     

    This will allow you to use the following approach instead:

    LookUp(
     Table2, 
     Dropdown1.Selected.Value = Column1 && varUserLanguage = Language, 
     Translation
    )

     

    Additionally, I would not recommend using direct table / list look-ups for translations. Each label would result in an API call and will have a noticable delay within the app (e.g. when navigating screens the text may not be visible yet). You could ClearCollect() all records in e.g. the OnStart to make sure they are accessible in memory and use the collection as your datasource - individual lookups will no longer result in API calls to your datasource.

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard