cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Cym
Level: Powered On

Set Default Person in People ComboBox from Directory

Hi there,

 

I have a form where there are several name fields (as datacards) that the user needs to search in to select the correct person - eg instead of where it says 'Find Items' (see attachment), i would like it to be auto populated with a particular person's details so that the user doesn't have to search in each box for the person each time. Most of the time it will be the same person, but there will be occasions where someone different would need to be selected. What i would like to do is have a default person set in each of the combo boxes. I am not sure how to go about this, as it will need to refer to the Directory, not a column in a SP list or similar. Currently Items for the Datacard is set as: Choices('Change Management 1_1.SWE_x0020_Name) and it is greyed out so that i can't change it. I think i'm supposed to put something in the Default field, but i don't know how to refer to the directory. 

Any assistance would be greatly appreciated. 

4 REPLIES 4
Community Support Team
Community Support Team

Re: Set Default Person in People ComboBox from Directory

Hi @Cym ,

Could you please share a bit more about the Directory that you mentioned?

Could you please share a bbit more about the 'SWE_x0020_Name' column? Is it a Person type column in your SP List?

 

If you want to set a default value within the People ComboBox within your Edit form, I have made a test on my side, please take a try with the following workaround:12.JPG

Fristly, on your side, you need to unlock the Person Data card (e.g. 'SWE Approver' Data card) which contains the People ComboBox.

Set the DefaultSelectedItems property of the ComboBox within the Person Data card in your Edit form to following:

If(
    EditForm1.Mode = FormMode.New,
    {
        Claims: "i:0#.f|membership|" & Lower(User().Email),
        DisplayName: User().FullName,
        Email: User().Email,
        Department: "", 
        JobTitle: "", 
        Picture: ""
    },
    Parent.Default
)

On your side, you should type (set the DefaultSelectedItems property of the ComboBox within the SWE Approver Data card):

If(
    EditForm1.Mode = FormMode.New,
    {
        Claims: "i:0#.f|membership|" & Lower("The email of the specific people"),
        DisplayName: "The Display name of the specific people",
        Email: "The email of the specific people",
        Department: "", 
        JobTitle: "", 
        Picture: ""
    },
    Parent.Default
)

Please check and see if the following blog would also help in your scenario:

https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/?utm_source=p...

 

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.
Cym
Level: Powered On

Re: Set Default Person in People ComboBox from Directory

Hi there,

 

thanks for this - the 'SWE_x0020_Name' column is a person type column.  The Directory i am referring to is our business address book on Office 365.  

 

I have tried to follow your instructions, however it still doesn't seem to work.  Here is what i have put into the DefaultSelectedItems box (also see attached image):

If(
    EditForm1.Mode = FormMode.New,
    {
        Claims: "i:0#.f|membership|" & Lower("Cymbaline.Cymbaline@company.com"),
        DisplayName: "Cymbaline Cymbaline",
        Email: "Cymbaline.cymbaline@company.com",
        Department: "",
        JobTitle: "",
        Picture: ""
    },
    Parent.Default

Community Support Team
Community Support Team

Re: Set Default Person in People ComboBox from Directory

Hi @Cym ,

Based on the screenshot you provided, I found that you have faced an error within the DefaultSelectedItems property of the ComboBox, could you please share more details about the error message?

 

Please make sure that the "Cymbaline.Cymbaline@company.com" email address (or 'Cymbaline Cymbaline') is existed in your Office 365 Organization.

 

In additon, do you enable "Allow multiple selections" option for the 'SWE_x0020_Name' person column in your SP list? If you have enabled the "Allow multiple selections" option for the 'SWE_x0020_Name' person column in your SP list, please consider modify above formula as below:

If(
    EditForm1.Mode = FormMode.New,
    Table({
            Claims: "i:0#.f|membership|" & Lower("Cymbaline.Cymbaline@company.com"),
            DisplayName: "Cymbaline Cymbaline",
            Email: "Cymbaline.cymbaline@company.com",
            Department: "", 
            JobTitle: "", 
            Picture: ""
    }),
    Parent.Default
)

Also please make sure you have enabled "Person Only" selection rather than "People and Groups" selection within your SP List settings as below:1.JPG

 

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.
Cym
Level: Powered On

Re: Set Default Person in People ComboBox from Directory

Hi Kris,

 

I've tried all this and checked the settings you have suggested, and still no luck Smiley Sad - any other ideas?

 

Thanks so much for your help,

 

Cym

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 44 members 4,890 guests
Please welcome our newest community members: