web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Power App dropdown and...
Power Apps
Unanswered

Power App dropdown and SQL Server View - show description when given a code?

(0) ShareShare
ReportReport
Posted on by 49

Hello

I am relatively new to Power Apps.

 

I want to have a dropdown in my Power Apps canvas app that shows the description of a health board given a code for that health board from ThisItem.

 

e.g. of view -

Code : AA Description : Ayrshire

Code : GL Description : Glasgow

...

 

ThisItem.BoardCode = GL, I want the dropdown to show Glasgow.

 

I have set my items of the dropdown to -

 

vwHealthBoard

 

with Value - boardCode

 

Default value to -

 

ThisItem.boardCode

 

 

When I run the dropdown shows the list of codes.

 

I tried changing the view value to boardDescription and the dropdown is empty.

 

So how do I change it so that the dropdown shows the description for the code?

 

Any help will be greatly appreciated.

 

Thanks

 

Kevin

 

 

Categories:
I have the same question (0)
  • NZ0090 Profile Picture
    317 on at

    Hi @KevBarrie ,

     

    Assuming vwHealthBoard is your table name, on the Items property of your dropdown, write:

    Distinct(vwHealthBoard, boardDescription)

     

    You can leave the Default property empty.

  • CU25081109-1 Profile Picture
    49 on at

     

    Hi @NZ0090

     

    I tried that.   It does display the list of boards in the dropdown.  But the default is blank, I want it to match with ThisItems.boardCode.  i.e. if ThisItems.boardCode = GL, the default items shows Glasgow.

     

    Thanks.

     

    Kevin

  • NZ0090 Profile Picture
    317 on at

    Where does ThisItems.boardCode came from? A gallery? Is the dropdown inside or outside of the gallery? And if it's a gallery, do you want the default pf the dropdown to be the selected boardcode of the gallery?

  • CU25081109-1 Profile Picture
    49 on at

    I have a collection that is a table from SQL Server - 

     

    ClearCollect(collectionDetails, tbldetails)

     

    I connect my gallery to this collection in items - 

    Last(FirstN(collectionDetails,recCount))

     

    This collection has the boardCode column.

     

    The dropdown is in this gallery.

     

    The items of the dropdown are a view of a table in SQL Server - 

    vwLUTDropdownHealthBoard

     

    This view holds the boardCode and board desc e.g. 

     

    BoardCode : "AA", BoardDescription : "Ayrshire"

    BoardCode : "GL", BoardDescription : "Glasgow"

     

    I want the dropdown to list all the BoardDescriptions and the default value to be the board description of code given.

     

    So when ThisItem.boardCode is "GL", the dropdown shows Glasgow.

     

    I hope that makes sense.

      

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard