cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

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
Highlighted
Community Support
Community Support

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.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

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.

View solution in original post

Highlighted
Anonymous
Not applicable

Re: New Form DataCardValue with Office365Users.SearchUser Person Object

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

 

@Anonymous 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,664)