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

Updating an SP List from an Office365Users data source

Hi Guys,

 

I've had a good trawl through similar questions but just can't seem to get this to work...

 

I would like to be able to pick a user from the Office365Users list and store the user details in a SharePoint List.

 

I have created a SharePoint List (Test People) with two columns:

  • Title: Out of the box as-is
  • Person:
    • Type: Person
    • Required: Yes

I can add records to this in SP and it happily lets me pick Users and add them.

 

I've gone on to create a Power App based on this list. I'm using the 'Start from data' method connecting to this List. When built, I add the Data Source; Office365Users.

 

The app consist of 3 screens, but the one I am interested in here is the EditScreen. To configure this:

  • Navigate to Person_DataCard/DataCardValue
  • Unlock to change properties.
  • Change the Data/Items field to: Office365Users.SearchUser({searchTerm : "", top:999})

Now, I know that this will not bring back a full list for a large number of user but our user base is quite small and, anyway, one thing at a time...

 

When I test this app:

  • I can successfully navigate to the Edit screen.
  • I put some random stuff into the Title field.
  • The down-arrow on the Person field successfully presents me with a list of my Users and, when I select one of these, the field is correctly populated.
  • I click the [Tick] button to save the record and this reports no error.
  • When I go to SharePoint to look at the content of the list:

SteveRoach_0-1595468512021.png

 

I've tried a few of the suggestions on this forum but don't seem to be able to get any of them to work. Can anyone point me in the right direction?

 

Cheers

 

Steve

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Updating an SP List from an Office365Users data source

Hi @SteveRoach ,

Do you want to populate the Person field ComboBox with users retrieved from the Office365Users.SearchUser() function?

Based on the issue that you mentioned, I think this issue is related to that you do not bind the selected user (retrieved from the Office365Users.SearchUser() function) in your Person field ComboBox to the Person field in your Edit form properly.

 

I have made a test on my side, please take a try with the following workaround:

Set the Update property of the Person field data card in the Edit form to following:

{ 
  Claims: "i:0#.f|membership|" & Lower(DataCardValue11.Selected.Mail),
  DisplayName: DataCardValue11.Selected.DisplayName,
  Email: DataCardValue11.Selected.Mail,
  Department: "",  
  JobTitle: "", 
  Picture: ""
}

3.JPG

Note: The DataCardValue11 represents the ComboBox inside my Person field data card.

 

On your side, you may try the following formula within the Update property of the Person field data card:

{ 
  Claims: "i:0#.f|membership|" & Lower(PersonFieldComboBox.Selected.Mail),
  DisplayName: PersonFieldComboBox.Selected.DisplayName,
  Email: PersonFieldComboBox.Selected.Mail,
  Department: "",  
  JobTitle: "", 
  Picture: ""
}

 

Please try above solution, then check if the issue is solved.

 

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

6 REPLIES 6
Highlighted
Super User III
Super User III

Re: Updating an SP List from an Office365Users data source

see patching person field in this post https://www.about365.nl/2018/11/01/handling-sharepoint-lookup-and-people-fields-in-powerapps/

 

you need to specify all of those parameters otherwise it will not populate correctly. This is kind of frustrating because in flow you just need the email address

Highlighted
Community Support
Community Support

Re: Updating an SP List from an Office365Users data source

Hi @SteveRoach ,

Do you want to populate the Person field ComboBox with users retrieved from the Office365Users.SearchUser() function?

Based on the issue that you mentioned, I think this issue is related to that you do not bind the selected user (retrieved from the Office365Users.SearchUser() function) in your Person field ComboBox to the Person field in your Edit form properly.

 

I have made a test on my side, please take a try with the following workaround:

Set the Update property of the Person field data card in the Edit form to following:

{ 
  Claims: "i:0#.f|membership|" & Lower(DataCardValue11.Selected.Mail),
  DisplayName: DataCardValue11.Selected.DisplayName,
  Email: DataCardValue11.Selected.Mail,
  Department: "",  
  JobTitle: "", 
  Picture: ""
}

3.JPG

Note: The DataCardValue11 represents the ComboBox inside my Person field data card.

 

On your side, you may try the following formula within the Update property of the Person field data card:

{ 
  Claims: "i:0#.f|membership|" & Lower(PersonFieldComboBox.Selected.Mail),
  DisplayName: PersonFieldComboBox.Selected.DisplayName,
  Email: PersonFieldComboBox.Selected.Mail,
  Department: "",  
  JobTitle: "", 
  Picture: ""
}

 

Please try above solution, then check if the issue is solved.

 

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

Re: Updating an SP List from an Office365Users data source

Hi jlindstrom,

I'm sorry, this doesn't seem to align with what I'm trying to do.

 

I have an EditForm screen with a data card: Person_DataCard2. Under this is a DataCardValue4.

 

I have put the following into the data card value/Items property: Office365Users.SearchUser({searchTerm : "", top:999})

This allows me to correctly pick a 365 user.

 

I don't really understand how this patching is supposed to work. It looks like I put the patch instruction into the data card Update property (is that right?). But the example given is nothing like either my App or List (I appreciate they may have different names but the structures don't look similar). What does "All of these properties can be pulled from the control itself:" mean?

 

I've tried this but it's throwing an error ('Test People' is my list, Person is a column in the list):

 
 

patch.jpg

And the error:

 

error.jpg

 

TIA

 

Steve

 

Highlighted
Frequent Visitor

Re: Updating an SP List from an Office365Users data source

Hi Kris Dai, I'm afraid I'm out of time to work on this this week. I'll get back to it on Monday and let you know how it went.

 

Cheers

 

Steve

Highlighted
Community Support
Community Support

Re: Updating an SP List from an Office365Users data source

Hi @SteveRoach ,

Sure. Regarding the needs that you mentioned, I think the solution I provided could achieve your needs. It's easy enough.

 

Please take a try with the solution I provided, if the issue is solved, please go ahead to click "Accept as Solution" to identify this thread has been solved.

 

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

Re: Updating an SP List from an Office365Users data source

Hi Kris,

 

That worked very well. Thanks you for your help with this.

 

Cheers

 

Steve

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

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

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

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