cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Patch Combo Box Selection to field/SP list

Hi, hope someone can help, been tearing my hair out!

 

I've got a powerapps form (based on Edit Form) which is designed to create a new item in a Sharepoint list, it's for marketing requests.

I had difficulty with other users being able to use the People picker fields (combo) to pull down O365 users to select for name or department, it would work for me, but not for anyone else. I resolved the first problem by granting access to the destination sharepoint list to all users and by using

Office365Users.SearchUser({searchTerm:cardName.SearchText})

Which now works to search for, and select a user.

My problem now is when I submit the form using the standard SubmitForm command, even though the user has made a selection, that selection doesn't go on to the sharepoint list, the column for name is just blank despite pulling all the other data through. Oddly, the form doesn't reject the entry for not having the 'required' name field, despite the fact the Sharepoint list then identifies it's a required field and needs completing Smiley Frustrated

 

I've tried patching the fields manually, but I cannot find the correct formula selection to make it pull through to my SP list. It keeps saying 'The type of this argument 'Name' does not match the expected type 'Record'. Found type 'Table'. To confirm, the Sharepoint list column 'name' is setup to accept People and Groups, so I'm totally stumped.

An example of the way I tried to patch it was this:

Patch('Marketing Service Requests', Defaults('Marketing Service Requests'), {Name: cardName.SelectedItems})

 

I've scoured the forum and managed to find a partial solution to make it convert the selection to text in a label using 

First(cardName.SelectedItems).DisplayName

And I could use this to provide the end user a label based summary of their selections before the form is submitted. However, ideally, on the sharepoint list I wanted it to stay as a O365 DisplayName field so it could be clicked to pull up employee details. 

 

Does anyone know how I can pull through via a submitform or a patch to make this work without having to convert it?

 

Thanks in advance.

 

James

 

 

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: Patch Combo Box Selection to field/SP list

Hi @jamesround86,

 

I have made a test using the SubmitForm function and the issue is confirmed on my side.

 

If you want to save Person value into your SP list without converting it, please take a try with the following workaround:7.JPG

 

 

Set the OnSelect property of the "Patch Record" button control to following formula:

Patch('20180713_case12',Defaults('20180713_case12'),
    {
     Title:DataCardValue1.Text,
     RequestContent:DataCardValue2.Text,
     Due_x0020_Date:DataCardValue4.SelectedDate,
     Requester:{
                 '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
                  Claims:"i:0#.f|membership|"&DataCardValue3.Selected.Mail,
                  DisplayName:DataCardValue3.Selected.DisplayName,
                  Department:"",
                  Email:DataCardValue3.Selected.Mail,
                  JobTitle:"",
                  Picture:""
               }
     }
)

Note: The DataCardValue3 represents the Combo box control within my Edit form.

 

On your side, you should type the following formula:

Patch('20180713_case12',Defaults('20180713_case12'),
    {
     Name:{
                 '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
                  Claims:"i:0#.f|membership|"&cardName.Selected.Mail,
                  DisplayName:cardName.Selected.DisplayName,
                  Department:"",
                  Email:cardName.Selected.Mail,
                  JobTitle:"",
                  Picture:""
               }
     }
)

The GIF image as below:Test1.gif

 

 

 

 

 

Best regards,

Kris

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
Regular Visitor

Re: Patch Combo Box Selection to field/SP list

Hi @v-xida-msft

 

Thank you for your detailed repsonse, I will give this a go.

 

If I have more than one field that's a person/group, or indeed other more standard fields, what sort of format do I need to put the code in? I've tried formatting it as you described but including more than once instance of the code you suggested for the people/group fields and it seems to have issue with the } character being used so many times?

 

Also, I've decided to put the form over several screens, rather than a single one, to make it easier for the user, are you able to advise of any restrictions or methods for collecting the inputted data across say 3 screens, displaying it all on a 4th to be reviewed and then how to patch submit that all in one go to a single SP list?

 

Many thanks

 

James

Highlighted
Frequent Visitor

Re: Patch Combo Box Selection to field/SP list

hi, @jamesround86 

As you solved it, I have a similar problem, when updating a search field that is the relation Id of a child table to a parent table.


Send me an error message 'Type of field expected Record' type of field found number...'

 

Thanks in advance

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (9,137)