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 / Select and Show Differ...
Power Apps
Answered

Select and Show Different Column in a Gallery Depending on Dropdown Selection

(0) ShareShare
ReportReport
Posted on by 15

I'm working on a gallery. This apps was built from a SharePoint List.

I want the label "etcTime" to switch and show contents from one of three columns, depending on selection of the dropdown "TrackStatusDataCard". I have tried below code, it didn't show mistake but nothing shows. Could anyone suggest what is going wrong?

Spriinter_0-1655471011629.png

Thank you so much!

Categories:
I have the same question (0)
  • trjackson77 Profile Picture
    254 on at

    Hi,

        your code is referencing the 'Selected' item in the gallery. Try:

    If(ThisItem.trackstatus = "Export", ThisItem.'PSA Est to Complete',false)
  • Spriinter Profile Picture
    15 on at

    No, sorry your code didn't work in my situation.

    My purpose is that, e.g. when "Export" was selected from the dropdown "TrackStatusDataCard" (from an edit form on another screen), the "ectTime" label on this gallery should show "PSA Est to Complete", which is one of the columns from my SharePoint List.

  • WarrenBelz Profile Picture
    155,491 Most Valuable Professional on at

    Hi @Spriinter ,

    There is nothing wrong with your code if: -

    • the selected item in TrackstatusDataCard is Export AND
    • ’PSA Est to Complete' is a field in the source of your gallery AND
    • it contains data in any of the records you are displaying

    To test both of these parameters, put two Labels in your gallery 

    TrackstatusDataCard.Selected.Value

    and

    ThisItem.'PSA Est to Complete'

    and you should find which one is the issue

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Spriinter Profile Picture
    15 on at

    Hello WarrenBelz,

     

    Thank you for the answer, but it still not showing what I want...I'm not sure what is going wrong.

    Please see below screenshot,

    Spriinter_0-1655741887157.png

    Now I put 2 labels, and it showed the first one, which is the code,

    TrackStatusDataCard.Selected.Value

    has problem. The second code works well.

    I re-checked the font and color, it should be good.

     

    To provide more context, here is my datasource looks like,

    Spriinter_1-1655742221947.png

    The "TrackStatusDataCard" was built from the list column "Track Status".

    What I want to achieve is that, an "if" statement runs when "Track Status" is "Export", it shows the data in "PSA Est to Complete" column, and so on...

     

    Thanks again!

     

    David

  • Spriinter Profile Picture
    15 on at

    Hello Again WarrenBelz,

     

    So here is my latest code, please see below,

    Spriinter_0-1655752824537.png

    no error warning, but still doesn't show anything.

    Actually this afternoon it showed once and I didn't even know why it showed, then I completed the code but nothing shows again.

     

    Let me know if your idea.

     

    Thank you!

     

    David

  • WarrenBelz Profile Picture
    155,491 Most Valuable Professional on at

    Hi @Spriinter ,

    Is TrackStatusCard, the Data Card or the Drop-down name? You need the drop-down.

  • Verified answer
    WarrenBelz Profile Picture
    155,491 Most Valuable Professional on at

    @Spriinter ,

    There is some bracketing wrong at the end and also a Text value - try this

    With(
     {
     wSet: Text(Thisltem.'CN Est Set Time',"hh:mm"),
     wEst: Text(ThisItem.'PSA Est to Complete', "hh:mm"),
     wPull: Text(ThisItem.'CN Est Pull Time',"hh:mm"),
     wStatus: TrackStatusDataCard.Selected.Value
     },
     Switch(
     wStatus,
     "Clear",
     wSet,
     "Export",
     wEst,
     "Empties,
     wEst,
     "To Top",
     wEst,
     wPull
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 414

#2
Valantis Profile Picture

Valantis 387

#3
timl Profile Picture

timl 344 Super User 2026 Season 1

Last 30 days Overall leaderboard