cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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.

View solution in original post

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.

View solution in original post

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
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 424 members 6,564 guests
Please welcome our newest community members: