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 Column name
Power Apps
Answered

Dynamic Column name

(2) ShareShare
ReportReport
Posted on by 9

Hi,

 

I'm new to powerapps. Would like to know is there any way to pass the column name dynamically? We have 50+ columns and 3000+ records(varies on each column) in SP List. Suppose lets say If user selects a value from the list of 50 distinct values and the dropdown should display the values from the respective column.(Column name and the User selection list are having same values)

 

 

Thanks in advance.

Categories:
I have the same question (0)
  • Verified answer
    RezaDorrani Profile Picture
    12,145 on at

    Hi @RamK 

     

    Dynamic columns is not currently possible

    Your option would be to call Flow and pass column name, flow can perform query and send response back to PowerApp (but that would be an overkill)

     

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

     

     

     

  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @RamK ,

    I'm afraid it's not supported to change fieldname dynamicly.

    For now, you need to clearly state which field that you want to display. 

    I suggest you express your views on PowerApps Ideas Forum. Your precious advice will be very helpful for our work.

    https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

    As an alternative way, you could try If statement to change displaying fieldname.

    For example, set the drop down2's Items:
    If(dropdown1.Selected.Value="fieldname1",listname.fieldname1,

    dropdown1.Selected.Value="fieldname2",listname.fieldname2,

    dropdown1.Selected.Value="fieldname3",listname.fieldname3,.......)

    Please replace fieldnames with the names that you use.

  • RamK Profile Picture
    9 on at

    Thank you Reza.

  • VK2 Profile Picture
    29 on at

    Anobody update on this?
    Would be helpful.

  • Suggested answer
    NickTT Profile Picture
    236 on at
    ​
    This is possible. In one of my projects, I had a column for each test environment, and I needed to read the value from that column based on what environment my project was deployed to. Below is a simplified table of what I my table looked like.
     
    Task Dev Test Prod
    LogWriteDelay 10 20 30
     
     
    What I did was use Power Automate to get that row from the table. Then I converted the data to XML and then used XPATH to dynamically select the column name based on an Environment Variable the workflow was deployed to. It worked perfectly. 
     

     
    Compose - Convert to XML:
    xml(json(concat('{ "root": ',body('Select'), ' }')))

     
    Output of the compose looks something like this:
    <root>
                <Task>LogWriteDelay</Task>
                <Dev>10</Dev>
                <Test>20</Test>
                <Prod>30</Prod>
    </root>

     
     
    Compose - Get Dynamic Column:
    first(xpath(outputs('Compose_-_Convert_to_XML'), concat('/root/',parameters('Environment (new_Environment)'),'/text()')))

     
    You could easily expand on this idea to pick the value based on what was selected in a drop-down menu or something.
    ​

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 547

#2
WarrenBelz Profile Picture

WarrenBelz 444 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard