Hi, again.
I am having a heck of a time figuing out how to patch a Offic365User variable into a SPO field formated as Person/Group.
What is the SPO column looking for?
In my form I do a Office365Users.SearchUser().DisplayName on a Drop down box. I get the name i'm looking for.
Then I try to patch it and all goes bad.
I've copied the DDbox.selected.value to a text box and tried to patch that, and it's also failed.
Here is the code for my last attempt:
Patch(JobsList2,Defaults(JobsList2),{Title: Text1.Text, JobNumber: Text2.Text, Foreman: TextBox10})
Any help would be appreciated
Solved! Go to Solution.
OK, I would suggest the following. I have tested it and it works in my case.
Patch(JobsList2, Defaults(JobsList2), {Title: Text1.Text, JobNumber: Text2.Text, Foreman: DDforeman.Selected.SPOperson})
This should work, please let me know how you get on or if you have any questions
Hi @Beuferd
From what is written here I think you need to make sure first of all that:
1) You are using SP Online
2) For Person or Group columns, the No option under Allow multiple selections must be selected. (And I would also set it as people only, not groups if that works for you)
If you are on SP online and have done 2, and you still cannot get it to work, please reply and I will experiment to try to find how we can make it work. In any case please let me know how you get on.
OK, this post explains what is going on, please see @rgruian's clear reply:
Basically SP requires a record to be patched, but the fields of that record are not the ones that Office365Users provides.
I have managed to sucessfully patch a user to an SPO list in a quick test just now, but it required loading the user list with the correct fields in a collection and then picking the right user from that collection. This is easier than it sounds if you have a finite list of less than 500 people. Given that you know your foremen, and unless you run a major construction business, then this is probably your case.
If you are still interested then I can guide you to a solution by continuing this conversation. Please let me know.
I am quite interested!
Please. I'm sure I could spend another couple of hours figuring out the solution on my own, but if you feed it to me, I would be one happy guy!
Yes, less than 500 people for awhile.
OK, I would suggest the following. I have tested it and it works in my case.
Patch(JobsList2, Defaults(JobsList2), {Title: Text1.Text, JobNumber: Text2.Text, Foreman: DDforeman.Selected.SPOperson})
This should work, please let me know how you get on or if you have any questions
So, it worked like a charm.
I dont' have many Foreman, but I have other work to do and don't want to maintain this list.
Any idea how to update the SPOpeople list automatically in Sharepoint?
Do you think I can pay my Admin so they can make it happen?
it would be great if I added or removed someone from the "Foreman" group the list would update?
Do you have any idea?
I'm thankfull for your help today.
!!
Hi @Beuferd, glad it has worked.
I think we can actually get away with not using an SPOpeople list now that we know how patching people to SPO works.
How do you obtain your list of foremen from Office365User in your PowerApp? (I understand that you populate a dropdown with a list of foremen)
What I am thinking is that we can recreate the SPO person record with all its fields from the information from Office365.
We just need to transform it and add the missing data. The odata.type field and some other fields do not seem to change from user to user.
Please let me know and we can progress.
I don't know if I need to do this yet.
I don't want to take up your time writing somehting that might not be utilized.
If I do see that I really need it, I will post back to this thread.
again, thanks for your help.
No worries. I do this in my spare time because I always learn something by solving real problems, and I get to help someone else on top.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
196 | |
71 | |
49 | |
36 | |
25 |
User | Count |
---|---|
242 | |
111 | |
89 | |
88 | |
66 |