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

New Form DataCardValue with Office365Users.SearchUser Person Object

I'm trying to Update DataCardValue (Sharepoint List Person Object)  with Office365Users.SearchUser({searchTerm: TextInput1.Text})  but i get error while submiting the form.

 

Please help.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: New Form DataCardValue with Office365Users.SearchUser Person Object

Hi @sharonde ,

Could you please share more details about the error message within your app?

Do you want to update the Person column of your SP List with the result the Office365Users.SearchUser({searchTerm: TextInput1.Text}) formula returns when you open a New form?

Where do you put the Office365Users.SearchUser({searchTerm: TextInput1.Text}) formula?

Further, do you enable "Allow Multiple Selections" option for the Person column in your SP List?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:

1. If the Person column is a Single selection column in your SP List:2.JPG

 

3.JPG

Set the DefaultSelectedItems property of the ComboBox within the Executor (Person column) data card in my Edit form to following:

If(
    EditForm1.Mode = FormMode.New,
    {
        Claims:"i:0#.f|membership|" & Lower(First(Office365Users.SearchUser({searchTerm: DataCardValue9.Text})).Mail),
        DisplayName: First(Office365Users.SearchUser({searchTerm: DataCardValue9.Text})).DisplayName,
        Email: First(Office365Users.SearchUser({searchTerm: DataCardValue9.Text})).Mail,
        JobTitle:"",
        Department:"",
        Picture:""
    },
    Parent.Default
)

On your side, you should 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(First(Office365Users.SearchUser({searchTerm: TextInput1.Text})).Mail),
        DisplayName: First(Office365Users.SearchUser({searchTerm: TextInput1.Text})).DisplayName,
        Email: First(Office365Users.SearchUser({searchTerm: TextInput1.Text})).Mail,
        JobTitle:"",
        Department:"",
        Picture:""
    },
    Parent.Default
)

 

2. If the Person column is a Multiple selections column in your SP List:

Please set the DefaultSelectedItems property of the ComboBox within the Person data card in your Edit form to following (save multiple person values into the Person column in your SP list):

If(
    EditForm1.Mode = FormMode.New,
    ForAll(
Office365Users.SearchUser({searchTerm: TextInput1.Text}),
{
Claims:"i:0#.f|membership|" & Lower(Mail),
DisplayName: DisplayName,
Email: Mail,
JobTitle:"",
Department:"",
Picture:""
}
), Parent.Default )

 

Please consider take a try with above solution I provided, then 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.
2 REPLIES 2
Community Support Team
Community Support Team

Re: New Form DataCardValue with Office365Users.SearchUser Person Object

Hi @sharonde ,

Could you please share more details about the error message within your app?

Do you want to update the Person column of your SP List with the result the Office365Users.SearchUser({searchTerm: TextInput1.Text}) formula returns when you open a New form?

Where do you put the Office365Users.SearchUser({searchTerm: TextInput1.Text}) formula?

Further, do you enable "Allow Multiple Selections" option for the Person column in your SP List?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:

1. If the Person column is a Single selection column in your SP List:2.JPG

 

3.JPG

Set the DefaultSelectedItems property of the ComboBox within the Executor (Person column) data card in my Edit form to following:

If(
    EditForm1.Mode = FormMode.New,
    {
        Claims:"i:0#.f|membership|" & Lower(First(Office365Users.SearchUser({searchTerm: DataCardValue9.Text})).Mail),
        DisplayName: First(Office365Users.SearchUser({searchTerm: DataCardValue9.Text})).DisplayName,
        Email: First(Office365Users.SearchUser({searchTerm: DataCardValue9.Text})).Mail,
        JobTitle:"",
        Department:"",
        Picture:""
    },
    Parent.Default
)

On your side, you should 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(First(Office365Users.SearchUser({searchTerm: TextInput1.Text})).Mail),
        DisplayName: First(Office365Users.SearchUser({searchTerm: TextInput1.Text})).DisplayName,
        Email: First(Office365Users.SearchUser({searchTerm: TextInput1.Text})).Mail,
        JobTitle:"",
        Department:"",
        Picture:""
    },
    Parent.Default
)

 

2. If the Person column is a Multiple selections column in your SP List:

Please set the DefaultSelectedItems property of the ComboBox within the Person data card in your Edit form to following (save multiple person values into the Person column in your SP list):

If(
    EditForm1.Mode = FormMode.New,
    ForAll(
Office365Users.SearchUser({searchTerm: TextInput1.Text}),
{
Claims:"i:0#.f|membership|" & Lower(Mail),
DisplayName: DisplayName,
Email: Mail,
JobTitle:"",
Department:"",
Picture:""
}
), Parent.Default )

 

Please consider take a try with above solution I provided, then 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
Administrator
Administrator

Re: New Form DataCardValue with Office365Users.SearchUser Person Object

Hi @sharonde how are you progressing with this? Was the above reply helpful?

 

@TopShelf-MSFT 

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

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

Top Kudoed Authors
Users Online
Currently online: 487 members 5,453 guests
Please welcome our newest community members: