Populate Dropdown with All People from List for Easy Selection

Introduction

This is a complex situation where a group of people is listed in a drop-down, and depending upon drop-down values, all the people from the list were drop-down selected value.

Scenario

We will create a PowerApps where the drop-down subject name will be populated. On Selection of subject, all the trainers will be populated. Then we will get the option to choose a trainer for that training.

Objective

Our objective would be to populate values from list rows on the selection of drop-down values.

Step 1. Create two lists.

We shall be creating two lists. The first list will store training details, and the second list will store trainer details.

Create two lists

The second list will maintain the trainers' details.

Second list

Step 2. Design the PowerApps for the trainer population scenario.

These are the basic steps to create power apps and design screens using the form. Since It is only for demo purposes, I have modified the form mode to new instead of Edit. That’s how the form is loaded correctly, and the output is shown correctly.

Design the PowerApps

Screen

Step 3. Connect with both data sources.

When we create a form, we all know we need to connect to datasource that is connected to the form. Also, it is mandatory to connect all data sources that are going to be used in the app. All the users should have permission to the lists so that they don’t run into an access denied error.

Data

Step 4. Write the formula for the Trainer group.

We are getting this value in drop-down control, Our requirement is to show all trainers and then from the populated value pick one to assign who will give the training. In the below screen, we can see trainers populated in the dropdown.

Trainer group

Below is the formula to populate all the trainers in the dropdown.

Formula

Step 5. Change the visualization of the Trainer group for readability purposes.

Exactly, as the headline suggests it is only for readability purpose, All the trainers will be concatenated and displayed in one text field as a string by a comma separated.

Change the visualization

Step 6. From the visualized people as trainers, show them in dropdown.

As the heading says, the visualized people as trainers are shown in the dropdown.

So that they can be assigned and stored in the SharePoint list.

SharePoint list

Step 7. Update the property of the Subject.

The subject is internally a title column. To avoid confusion I have shown the updated property of the subject too.

Update the property

Step 8. Update the property of TrainerAssigned.

The update property of Trainer Assigned is simple which is just the selection of drop-down value gets saved.

TrainerAssigned

Step 9. DisplayFields property of TrainersAssigned.

We can display all three details along with a picture that looks good too. Otherwise, only Display Name also works well.

DisplayFields property

The output of changing the DisplayFields property would look like this

Output of changing

Step 10. Update the property of TrainersGroup.

This is interesting to update, It should update the entire group. If we update the dropdown value, we will have to select all the values manually or select only one value in the drop-down. So as per this approach this is the easiest way to save the Trainers Group.

Update

Conclusion

In this article, we saw how to populate a group depending upon a drop-down value, how to save them, and how to use one of the values from the group and save them in the list again. The people picker is the complex column, and at certain times, we can not save it directly at times as needed.


Similar Articles