cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LukasSliuzas
Helper II
Helper II

Poeple picker auto fill with if statement, multiple users

Hello,

 

I have been trying to auto fill people picker field based on if statement. I was successful on automatically filling with one user:
If( ProcessData.Selected.Value = "Something",
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Claims:"i:0#.f|membership|" & "User email",
Department: "",
DisplayName: "User name",
Email: "",
JobTitle: ".",
Picture: "."
}

 

I am trying to achieve that if ProccesData = Something2 it will fill the field with two users or even more, based on selection.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
FabianAckeret
Super User
Super User

Hi @LukasSliuzas 

 

If you'd like to add two specific users in the combobox, click on it and go to the DefaultSelectedItems property.

You can then add as many defaulted users as you like as follows:

Table(
    {
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
        Claims:"i:0#.f|membership|" & <user.email>,
        Department: "",
        DisplayName: <user.fullname>,
        Email: <user.email>,
        JobTitle: "",
        Picture: ""
    },
    {
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
        Claims:"i:0#.f|membership|" & <user2.email>,
        Department: "",
        DisplayName: <user2.fullname>,
        Email: <user2.email>,
        JobTitle: "",
        Picture: ""
    }
)

 

I hope this helps.

 

Kind regards,

Fabian


Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.


Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.

View solution in original post

1 REPLY 1
FabianAckeret
Super User
Super User

Hi @LukasSliuzas 

 

If you'd like to add two specific users in the combobox, click on it and go to the DefaultSelectedItems property.

You can then add as many defaulted users as you like as follows:

Table(
    {
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
        Claims:"i:0#.f|membership|" & <user.email>,
        Department: "",
        DisplayName: <user.fullname>,
        Email: <user.email>,
        JobTitle: "",
        Picture: ""
    },
    {
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
        Claims:"i:0#.f|membership|" & <user2.email>,
        Department: "",
        DisplayName: <user2.fullname>,
        Email: <user2.email>,
        JobTitle: "",
        Picture: ""
    }
)

 

I hope this helps.

 

Kind regards,

Fabian


Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.


Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (3,226)