cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kadd
Resolver I
Resolver I

Saving combobox (people picker) value from a gallery to SharePoint list

Hey all,

 

Hope you're doing well.

 

Ok...I'm struggling again on something. I searched a lot, found some answers, they were all saying "yes it works !!" but when i tested ...no it didn't 😛

I have a list on SharePoint with a people picker field. On PowerApps, i have a gallery where I put a Combobox (Combobox1) that i configured so that I can find my users in it . I've put this in the "Item" property of my combobox :

 

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

 

That works.

I have a save icon on each item of my gallery, when I click it , the Patch function saves all the values of the current gallery item except the people picker that says blank.

 

Patch(KeyExperts,ThisItem,{KEDPID:varID,KEDept:varDept,KEProc:varProc,KEAct:TextInput34.Text,KEFunction:Dropdown11.Selected,KELocation:Dropdown12.Selected,KEDesc:TextInput45.Text, Expert: XXXXXX, OutsourcedExpert:TextInput47.Text, GallerySort:1});

 

The people picker field is "Expert" and i tried several things...

 

* Combobox1.selected.value

* Combobox1.SelectedItems

* I found 3 or 4 different versions using odata attributes

* the last one i'm trying is coming from a post i found in the forum (and that is pretty similar to something i tried before :

 

{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",Claims:"i:0#.f|membership|"&ComboBox1.Selected.Mail,DisplayName: ComboBox1.Selected.DisplayName}

 

The problem is when i do this, PowerApps shows an error and says it missing the Department, then I add it so then it's missing the job title, i add it then it's missing something else and something else etc...and i end up with the system asking me to add things that do not exist (I mean that i can't find them in the list of attributes)

 

Would one of you be able to help me and explain me how i can patch my combobox-people picker to my people picker field in my SharePoint list ?

 

Thanks a lot in advance for your time.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kadd
Resolver I
Resolver I

Hi @RezaDorrani ,

 

Thanks a lot for your reply.

 

I just watched your video, which is really cool but... you're using User() which saves yourself to the SharePoint List. The thing is i'm trying to save my Combobox selection into the SahrePoint list. I adapted like this :

 

Expert:{
Claims: Concatenate(
"i:0#.f|membership|",
ComboBox1.Selected.Mail // Person email
),
Department: "",
DisplayName: ComboBox1.Selected.DisplayName,
Email: ComboBox1.Selected.Mail, // Person email
JobTitle: "",
Picture: ""
}

 

Which works with my name but not with other ones, in the sens that I have an additional (external) user in my active directory, i select her, but it makes an error saying she doesn't exist... (ah ok...i figured out this might be because i'm not sharing this test site outside...)

 

Now another problem is to show the result of the SharePoint list back to my gallery. It works for all the fields , but not for the Expert field.

 

I put "ThisItem.Expert" in the default property of my combobox but it doesn't show anything. Any idea how i could solve this ?

 

Thanks a lot again !

 

Edit :  Ah ok !!! i think i did it . I added " [ThisItem.Expert.DisplayName] " to the Combobox property "DefaultSelectedItem". Now I have my name sowing up 🙂

 

 

View solution in original post

2 REPLIES 2
RezaDorrani
Dual Super User II
Dual Super User II

Hi @Kadd 

 

The people picker column requires a peculiar format for patching.

I have covered this scenario in my video

https://www.youtube.com/watch?v=g9ChYuTdNd4

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Thanks,
Reza Dorrani, MVP
YouTube
Twitter

Kadd
Resolver I
Resolver I

Hi @RezaDorrani ,

 

Thanks a lot for your reply.

 

I just watched your video, which is really cool but... you're using User() which saves yourself to the SharePoint List. The thing is i'm trying to save my Combobox selection into the SahrePoint list. I adapted like this :

 

Expert:{
Claims: Concatenate(
"i:0#.f|membership|",
ComboBox1.Selected.Mail // Person email
),
Department: "",
DisplayName: ComboBox1.Selected.DisplayName,
Email: ComboBox1.Selected.Mail, // Person email
JobTitle: "",
Picture: ""
}

 

Which works with my name but not with other ones, in the sens that I have an additional (external) user in my active directory, i select her, but it makes an error saying she doesn't exist... (ah ok...i figured out this might be because i'm not sharing this test site outside...)

 

Now another problem is to show the result of the SharePoint list back to my gallery. It works for all the fields , but not for the Expert field.

 

I put "ThisItem.Expert" in the default property of my combobox but it doesn't show anything. Any idea how i could solve this ?

 

Thanks a lot again !

 

Edit :  Ah ok !!! i think i did it . I added " [ThisItem.Expert.DisplayName] " to the Combobox property "DefaultSelectedItem". Now I have my name sowing up 🙂

 

 

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (46,093)