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.
The second list will maintain the trainers' details.
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.
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.
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.
Below is the formula to populate all the trainers in the dropdown.
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.
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.
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.
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.
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.
The output of changing the DisplayFields property would look like this
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.
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.