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 / Dynamic Lookup formula
Power Apps
Answered

Dynamic Lookup formula

(0) ShareShare
ReportReport
Posted on by 362

I am trying to write a Lookup formula where the lookup field name is provisioned by a Dropdown_A.

To explain the concept, here's what I've tried and has obviously failed 🙂

Lookup(DataSource,ID=ValueFromOtherControl).DropdownA.SelectedText.Value

With the part in bold being the field value I'd like the formula to return.

Is this doable?

Categories:
  • NZ0090 Profile Picture
    317 on at

    @Gilmour Do you want the result of the LookUp to be inside dropdown A or do you have two filters inside the LookUp function (one from other control and another one from dropdown A)? Is Dropdown_A and DropdownA.SelectedText.Value the same dropdown?

  • Gilmour Profile Picture
    362 on at

    Hi @NZ0090 ,

     

    No, the result of the lookup formula will be returned in a text label (TextLabel_A).

     

    The sketch below shows what I am trying to achieve:

     

    Gilmour_1-1686019509725.png

     

     

    In essence, get the lookup field name in the formula from the selection in Dropdown_A.

     

    Hope it makes sense.

  • Verified answer
    NZ0090 Profile Picture
    317 on at

    @Gilmour Thanks for the diagram! That really helps to visualize it. So basically you want something like:

    LookUp(Datasource, ID=Y, ColumnX)

    where the value of ColumnX change dynamically based on the dropdown right?

     

    As far as I know, there's no way to change column name dynamically yet.  Maybe you can do something like this?

    If(
    	DropdownA.SelectedText.Value="ColumnA",
    	LookUp(Datasource, ID=Y, ColumnA),
    
    	DropdownA.SelectedText.Value="ColumnB",
    	LookUp(Datasource, ID=Y, ColumnB)
    
    	DropdownA.SelectedText.Value="ColumnX",
    	LookUp(Datasource, ID=Y, ColumnX)
    )

     

  • Gilmour Profile Picture
    362 on at

    Hi @NZ0090 , thank you for helping!... and confirming that there is really no function to do that. I came pretty much to the same conclusion. It's gonna be a long formula for sure!

     

    Thanks again!

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

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
timl Profile Picture

timl 122 Super User 2026 Season 2

Last 30 days Overall leaderboard