Hello All,
I have a form in powerApps that is linked to a Sharepoint list.
I've been trying to populate a people picker in this form with current user info.
I thought I figured it out using Office365Users.MyProfile() in the default field of the card.
However, when I submit the form to my sharepoint list the user information does not go through.
Any help with this would be greatly appreciated.
Solved! Go to Solution.
I just had a breakthrough with this issue.
I found this Microsoft blog post in the description of a random youtube video
https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/
In the screens OnVisible property I put
Set(myself, User())
In the Combo Boxes DefaultSelectedItem property I put
If( EditForm1.Mode = FormMode.New, { DisplayName: myself.FullName, Claims: "i:0#.f|membership|" & myself.Email }, Parent.Default)
Be sure to change the form name in red to correspond to your form.
Now my PowerApp will autofill the Person Box with the current user, and submit to my sharepoint list.
Thanks again for the help iAm_ManCat
Hi,
Have you checked the Update value for the datacard, you may need it to point to the OData value of your Office365 User Lookup as People pickers require OData values (which are normally present when they use the standard lookup vs pre-filling it):
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:"i:0#f|membership|" & DataCardValue6.Selected.Email,
Department:"",
DisplayName:DataCardValue6.Selected.Email,
JobTitle:"",
Pictures:"",
Email:DataCardValue6.Selected.Email
}
Could you try something like that and let me know how you get on?
Thanks,
ManCat
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
You'll have to forgive me, I've very new to PowerApps.
I took all of the code you provided and put it into the update field of the Requester datacard.
I also changed it accordingly.
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:"i:0#f|membership|" & DataCardValue8.Selected.Email,
Department:"",
DisplayName:DataCardValue8.Selected.Email,
JobTitle:"",
Pictures:"",
Email:DataCardValue8.Selected.Email
}
I'm getting a "Not a valid connector error response"
Thanks for the help so far.
Let me know if there's any other info I could provide
Heya!
That's ok, we're all at different stages of learning 🙂
Your 'Assigned To' card is the one you are defaulting, correct? if you click the DataCard (larger container) for that either in the editor or on your left-hand list of objects, then on your right side you should see some properties - click advanced and then check what it is using for Update - this is the value it will use when the form is submitted to update/fill that field:
This is then where the formula I gave you should go (click the Update label itself to go to the formula bar):
@Shanescows did a good video on patching SharePoint Online using complex columns (and has LOADS of other videos on his channel for anyone learning Power Apps):
https://www.youtube.com/watch?v=gsk14D-CYRE
If you could give that a try and then let me know if we're any closer to a result - Did you add any code to the bottom button that is showing the error? If yes, we may need to remove that.
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
Still no luck getting this to work.
I'll update the thread if I find a solution
I just had a breakthrough with this issue.
I found this Microsoft blog post in the description of a random youtube video
https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/
In the screens OnVisible property I put
Set(myself, User())
In the Combo Boxes DefaultSelectedItem property I put
If( EditForm1.Mode = FormMode.New, { DisplayName: myself.FullName, Claims: "i:0#.f|membership|" & myself.Email }, Parent.Default)
Be sure to change the form name in red to correspond to your form.
Now my PowerApp will autofill the Person Box with the current user, and submit to my sharepoint list.
Thanks again for the help iAm_ManCat
This works correctly
I looked all afternoon for a solution, Thanks.
Only change here was SharePointForm1.Mode = FormMode.New,
User | Count |
---|---|
256 | |
107 | |
90 | |
51 | |
44 |