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

How to save a user to a sharepoint list from PowerApps?

I have a sharepoint sheet, in which one of the columns is a person.
I have created a new application in which I add a new line.
In the application, I created a form that I connected to the list.
I added to DefaultSelectItem I am using

{
'@ odata.type': "# Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
DisplayName: User (). FullName,
Claims: "i: 0 # .f | membership |" & Lower (User (). Email),
Department: "",
Email: User (). Email
}


In Items, I added: 

Office365Users.SearchUser ({searchTerm: DataCardValue3.SearchText}). DisplayName

and allowed field search.

It turned out great. By default, there is the mail of the person who opened the application, it is possible to search and edit.
That's just not saved 😃
After clicking the button with "SubmitForm (Form4);" the string is created, but the field named is empty.

How to find out what exactly is sent from the field and how to make it save the user to the list?

1 ACCEPTED SOLUTION

Accepted Solutions
v-albai-msft
Community Support
Community Support

Hi @UK141RUS ,

Do you mean you cannot save the value of the custom person control into your list?

Is DataCardValue3 the name of your Person combo box inside the form?

Seems that you have set the DefaultSelectItem property and Items property for this person combo box.

 

If my understand is correct, you can try this solution.

1. Set the items property of the Items property to(without .DisplayName, so that you can use DataCardValue3.Selected.Mail in next step):

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

v-albai-msft_0-1620021402232.png

 

2. Set the Update property of the this Person DataCard to following:

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

v-albai-msft_1-1620021402238.png

 

Besides, for your second question, if you want to save to your list only when address= defaultAddressText, you can try formula like below for your submit button:

If(addresscontrolname.Text="defaultAddressText",SubmitForm (Form4))

This time, only when address is a default address value, Submitform action can work.

Best regards,

Allen

View solution in original post

3 REPLIES 3
UK141RUS
Frequent Visitor

Oh yes. Important note.
If you leave my address (which is by default), then it will be saved to the list, but if you change it to something else, then it will not be saved.

v-albai-msft
Community Support
Community Support

Hi @UK141RUS ,

Do you mean you cannot save the value of the custom person control into your list?

Is DataCardValue3 the name of your Person combo box inside the form?

Seems that you have set the DefaultSelectItem property and Items property for this person combo box.

 

If my understand is correct, you can try this solution.

1. Set the items property of the Items property to(without .DisplayName, so that you can use DataCardValue3.Selected.Mail in next step):

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

v-albai-msft_0-1620021402232.png

 

2. Set the Update property of the this Person DataCard to following:

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

v-albai-msft_1-1620021402238.png

 

Besides, for your second question, if you want to save to your list only when address= defaultAddressText, you can try formula like below for your submit button:

If(addresscontrolname.Text="defaultAddressText",SubmitForm (Form4))

This time, only when address is a default address value, Submitform action can work.

Best regards,

Allen

View solution in original post

Del

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

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

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (20,483)