cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

update people picker field based on another field value from a list

Hello guys,

 

I have a list which contains region and regional leader(People picker) columns, I'm using list values for another list application here I'm able to retrieve the Region values as below screen and OnStart formula for your reference then Items : RegionWithBlank for the dropdown field . It was working fine as we want, now I need to retrieve the person from the same list to this application when we selected the region dropdown. Please help me out to resolve it. Thanks in advanceRR.JPG

 

ClearCollect(RegionWithBlank,{Title:""});Collect(RegionWithBlank,Distinct(Filter(EUS_DAT_CS_REGION,Not(StartsWith(Title,"GLOBAL"))),Title))

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: update people picker field based on another field value from a list

Hi @ShaikSayyad ,

Do you mean that your Regional Leader ComboBox contains duplicated records?

Do you want to display distinct records within the Regional Leader ComboBox?

 

If you want to display distinct records within the Regional Leader ComboBox, please take a try with the following workaround:

On your side, within the Edit form, you should set the OnChange property of the Region_dpd box to following:

ClearCollect(
             RegionLeaderCollection,
             ForAll(
                    Filter(EUS_DAT_CS_REGION, Title=Dropdown1.Selected.Value).'Regional Leader',
                    {
                      DisplayName: 'Regional Leader'.DisplayName,
                      Claims: "i:0#.f|membership|" & Lower('Regional Leader'.Email),
                      Email: 'Regional Leader'.Email,
                      Department: 'Regional Leader'.Department,
                      JobTitle: 'Regional Leader'.JobTitle,
                      Picture: 'Regional Leader'.Picture
                   }
            )
);
ForAll( /* <-- Add formula here to remove duplicated records */
RenameColumns(RegionalLeaderCollection, "Email", "Email1"),
If(
CountRows(Filter(RegionalLeaderCollection, Email = Email1)) > 1,
Remove(RegionalLeaderCollection, LookUp(RegionalLeaderCollection, Email = Email1))
)
)

Note: The 'Regional Leader' column represents the Person column in your 'EUS_DAT_CS_REGION' SP List.

Then set the the Items property of the ComboBox control (ComboBox1) or Dropdown control (Dropdown2) within the Regional Leader Data card to following:

RegionalLeaderCollection

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Highlighted
Super User
Super User

Re: update people picker field based on another field value from a list

Shane Young has an excellent video on Cascading Dropdowns which may be of help to you:  https://www.youtube.com/watch?v=pkZG2boN7jQ.  

Highlighted
Community Support
Community Support

Re: update people picker field based on another field value from a list

Hi @ShaikSayyad ,

Do you want to populate your Regional Leader Dropdown box/ComboBox based on the selected value within the Region Dropdown box?

Is the Regional Leader column a Person type column in your another SP list which the Edit form connects to?

 

If you want to populate your Regional Leader Dropdown box/ComboBox based on the selected value within the Region Dropdown box, I have made a test on my side, please take a try with the following workaround:5.JPG

 

6.JPG

Set the OnChange property of the Region Dropdown box to following:

ClearCollect(
             RegionLeaderCollection,
             ForAll(
                    Filter('20190325_case13', Region.Value=Dropdown1.Selected.Value).Executor,
                    {
                      DisplayName: Executor.DisplayName,
                      Claims: "i:0#.f|membership|" & Lower(Executor.Email),
                      Email: Executor.Email,
                      Department: Executor.Department,
                      JobTitle: Executor.JobTitle,
                      Picture: Executor.Picture
                   }
            )
)

Note: Within my SP list '20190325_case13', The Region column is a Choice type column, and the Executor is a Person column.

On your side, within the Edit form, you should set the OnChange property of the Region_dpd box to following:

ClearCollect(
             RegionLeaderCollection,
             ForAll(
                    Filter(EUS_DAT_CS_REGION, Title=Dropdown1.Selected.Value).'Regional Leader',
                    {
                      DisplayName: 'Regional Leader'.DisplayName,
                      Claims: "i:0#.f|membership|" & Lower('Regional Leader'.Email),
                      Email: 'Regional Leader'.Email,
                      Department: 'Regional Leader'.Department,
                      JobTitle: 'Regional Leader'.JobTitle,
                      Picture: 'Regional Leader'.Picture
                   }
            )
)

Note: The 'Regional Leader' column represents the Person column in your 'EUS_DAT_CS_REGION' SP List.

Within Regional Leader Data card, set the Items property of the ComboBox control (ComboBox1) or Dropdown control (Dropdown2) to following:

RegionLeaderCollection

Set the Update property of the Regional Leader Data card to following:

ComboBox1.Selected            /* <-- Or Dropdown2.Selected */

Please check the following GIF screenshot for more details:Test.gif

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Helper I
Helper I

Re: update people picker field based on another field value from a list

Thanks for your response,

 

I got the most solution, but we have multiple records with same region and regional leader fields here it is the screen for your reference.

and coming to app dropdown Regional Leader(Distint values only) has to be auto populate when we had changed region . please refer belowApplication resultApplication resultListList screens

Highlighted
Community Support
Community Support

Re: update people picker field based on another field value from a list

Hi @ShaikSayyad ,

Do you mean that your Regional Leader ComboBox contains duplicated records?

Do you want to display distinct records within the Regional Leader ComboBox?

 

If you want to display distinct records within the Regional Leader ComboBox, please take a try with the following workaround:

On your side, within the Edit form, you should set the OnChange property of the Region_dpd box to following:

ClearCollect(
             RegionLeaderCollection,
             ForAll(
                    Filter(EUS_DAT_CS_REGION, Title=Dropdown1.Selected.Value).'Regional Leader',
                    {
                      DisplayName: 'Regional Leader'.DisplayName,
                      Claims: "i:0#.f|membership|" & Lower('Regional Leader'.Email),
                      Email: 'Regional Leader'.Email,
                      Department: 'Regional Leader'.Department,
                      JobTitle: 'Regional Leader'.JobTitle,
                      Picture: 'Regional Leader'.Picture
                   }
            )
);
ForAll( /* <-- Add formula here to remove duplicated records */
RenameColumns(RegionalLeaderCollection, "Email", "Email1"),
If(
CountRows(Filter(RegionalLeaderCollection, Email = Email1)) > 1,
Remove(RegionalLeaderCollection, LookUp(RegionalLeaderCollection, Email = Email1))
)
)

Note: The 'Regional Leader' column represents the Person column in your 'EUS_DAT_CS_REGION' SP List.

Then set the the Items property of the ComboBox control (ComboBox1) or Dropdown control (Dropdown2) within the Regional Leader Data card to following:

RegionalLeaderCollection

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Helper I
Helper I

Re: update people picker field based on another field value from a list

Thanks for your help.

 

I have one issue now that the list was not updating Regional Leader field value(There is no errors in my application it was working fine). can you please suggest me to solve this.

 

Thanks

Highlighted
Helper I
Helper I

Re: update people picker field based on another field value from a list

Hello @v-xida-msft ,

 

The above code and procedure was working fine but the final result has not storing to the current list (people picker field was not updating the dropdown value) could you please help as soon as possible.

 

Thanks.

Highlighted
Frequent Visitor

Re: update people picker field based on another field value from a list

We have tried implement like your code  but we are getting the below error ..Approve is multi person filed and error is throwing at highlighted part in the code

Error :invalid argument exception , expecting one of following number,text,optionsetvalue, boolean

My code :

 

ClearCollect(
RegionLeaderCollection,
ForAll(
Filter(Approver, Amount=DataCardValue5.Text).Approve,
{
DisplayName: Approve.DisplayName,
Claims: "i:0#.f|membership|" & Lower(Approve.Email),
Email: Approve.Email,
Department: "",
JobTitle: "",
Picture: ""
}
)
)

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,649)