cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
learningflow
Frequent Visitor

How to load SQL table field values into a Drop down control

Hi,

 

I am working on developing a mobile app containing about 4 fields. The data source is sql table  (on prem), connected with gateway connection and added as data source in my app. See screenshot below for the dd control properties. 

learningflow_0-1631645882756.png

 With this config, it loads all values from field 'personnelfirstname' into the dd. However, I would like to load 'PersonnelFirstName PersonnelLastName' into the dd as concatenated value with space. Can someone help me with the expression to set for items property, this should be simple enough but I am unable to figure it out. Also, once this is configured, I would like to display 'PersonnelID' in a label based on the selection in dd, any help on this would be greatly appreciated, thanks in advance. 

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

@learningflow 

You can do this by setting the Items property of your dropdown to the following:

AddColumns(tblPersonnel,  
           "Fullname",
           PersonnelFirstName & " " & PersonnelLastName 
)

To show the PersonnelID in a label, you would set the Text property to the following:

Dropdown1.Selected.PersonnelID

Note that if the label shows up blank, you may need to explicitly specify the column names by amending the Items property of your dropdown like so:

 

ShowColumns(AddColumns(tblPersonnel,  
              "Fullname",
              PersonnelFirstName & " " & PersonnelLastName 
                       ),
             "Fullname",
             "PersonnelID"
)

 

 

 

 

 

View solution in original post

6 REPLIES 6
rampprakash
Impactful Individual
Impactful Individual

Hello @learningflow,

 

You can try using

 

Choices(SqlTableName.FieldName) in the items of DD

 

Please mark as Answer if it is helpful and provide Kudos

Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com

Thanks @rampprakash , however it does not work. 

learningflow_0-1631646423659.png

 

timl
Super User
Super User

@learningflow 

You can do this by setting the Items property of your dropdown to the following:

AddColumns(tblPersonnel,  
           "Fullname",
           PersonnelFirstName & " " & PersonnelLastName 
)

To show the PersonnelID in a label, you would set the Text property to the following:

Dropdown1.Selected.PersonnelID

Note that if the label shows up blank, you may need to explicitly specify the column names by amending the Items property of your dropdown like so:

 

ShowColumns(AddColumns(tblPersonnel,  
              "Fullname",
              PersonnelFirstName & " " & PersonnelLastName 
                       ),
             "Fullname",
             "PersonnelID"
)

 

 

 

 

 

View solution in original post

thanks @timl , I tried your approach for the items property of dd. However its not loading full name. Please see below. Also, what is 'Fullname' represent here?

learningflow_0-1631647145271.png

 

timl
Super User
Super User

Hi @learningflow 

Fullname is the field that would return the concatinated value of PersonnelFirstname and PersonnelLastName.

Could you confirm that you've set the Value property of the dropdown control to Fullname?

Excellent @timl , thanks so much for your help, it worked. 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (924)