Hi all,
I encountered a problem and am curious if someone of you already did something similar.
I have a Datasource which is a SP List. This List have a Column for "Person/Groups". I am building a Powerapp which should add values to this column. When it comes to Persons its working just fine with the following code:
Now i want to add a Group to the SP List but i cannot get it working.
I would be glad if someone of you got an idea or even a solution for it.
Thank you in advance
Felix
Solved! Go to Solution.
Hi @fher ,
Could you please share a bit more about your scenario?
Do you enable the "Allow selection of Groups" option for the "Person" field in your SP list?
Further, could you please share a bit more about the ComboBox1 mentioned in your formula?
Based on the formula you provided, I think there is something wrong with it. I have made a test on my side, please take a try with the following workaround:
1. If you do not enable the "Allow selection of Groups" option for the "Person" field in your SP list:
Please modify your Patch formula as below (Patch Person/User data back to the "Verwalter" field in your SP list😞
Patch( KontingentverwaltungUser; Defaults(KontingentverwaltungUser); { Title: ComboBox1_1.Selected.DisplayName; Verwalter: {
Claims: "i:0#.f|membership|" & Lower(ComboBox1.Selected.email); /* <-- Please type ComboBox1.Selected.email rather than ComboBox1.Selected.displayName */ DisplayName: ComboBox1_1.Selected.DisplayName;
Email: ComboBox1.Selected.email; Department: ""; JobTitle: ""; Picture: "" } } )
2. If you enable the "Allow selection of Groups" option for the "Person" field in your SP list (patch a Group value back to the "Verwalter" field in your SP list😞
Firstly, you need to find the Claims property for groups in your Org. On your side, please add the following formula within the OnSelect property of a button:
ClearCollect(Colelction1, Choices(KontingentverwaltungUser.Verwalter))
then go to review the Collection1, the Claim property for groups would looks like as below:
after that, you should retrieve the group id based on the selected group name using the following formula:
LookUp(Office365Groups.ListOwnedGroupsV2().value, displayName = ComboBox1.Selected.displayName).id
then you need to modify above Patch formula as below:
Patch( KontingentverwaltungUser; Defaults(KontingentverwaltungUser); { Title: ComboBox1_1.Selected.DisplayName; Verwalter: {
Claims: "c:0o.c|federateddirectoryclaimprovider|" & LookUp(Office365Groups.ListOwnedGroupsV2().value, displayName = ComboBox1.Selected.displayName).id; /* <-- Please type ComboBox1.Selected.email rather than ComboBox1.Selected.displayName */ DisplayName: ComboBox1_1.Selected.DisplayName;
Email: ComboBox1.Selected.email; Department: ""; JobTitle: ""; Picture: "" } } )
The 'c:0o.c|federateddirectoryclaimprovider|' value in above formula should be replaced with the corresponding value on your side.
Please take a try with above solution, then check if the issue is solved.
Best regards,
Hi @fher ,
Could you please share a bit more about your scenario?
Do you enable the "Allow selection of Groups" option for the "Person" field in your SP list?
Further, could you please share a bit more about the ComboBox1 mentioned in your formula?
Based on the formula you provided, I think there is something wrong with it. I have made a test on my side, please take a try with the following workaround:
1. If you do not enable the "Allow selection of Groups" option for the "Person" field in your SP list:
Please modify your Patch formula as below (Patch Person/User data back to the "Verwalter" field in your SP list😞
Patch( KontingentverwaltungUser; Defaults(KontingentverwaltungUser); { Title: ComboBox1_1.Selected.DisplayName; Verwalter: {
Claims: "i:0#.f|membership|" & Lower(ComboBox1.Selected.email); /* <-- Please type ComboBox1.Selected.email rather than ComboBox1.Selected.displayName */ DisplayName: ComboBox1_1.Selected.DisplayName;
Email: ComboBox1.Selected.email; Department: ""; JobTitle: ""; Picture: "" } } )
2. If you enable the "Allow selection of Groups" option for the "Person" field in your SP list (patch a Group value back to the "Verwalter" field in your SP list😞
Firstly, you need to find the Claims property for groups in your Org. On your side, please add the following formula within the OnSelect property of a button:
ClearCollect(Colelction1, Choices(KontingentverwaltungUser.Verwalter))
then go to review the Collection1, the Claim property for groups would looks like as below:
after that, you should retrieve the group id based on the selected group name using the following formula:
LookUp(Office365Groups.ListOwnedGroupsV2().value, displayName = ComboBox1.Selected.displayName).id
then you need to modify above Patch formula as below:
Patch( KontingentverwaltungUser; Defaults(KontingentverwaltungUser); { Title: ComboBox1_1.Selected.DisplayName; Verwalter: {
Claims: "c:0o.c|federateddirectoryclaimprovider|" & LookUp(Office365Groups.ListOwnedGroupsV2().value, displayName = ComboBox1.Selected.displayName).id; /* <-- Please type ComboBox1.Selected.email rather than ComboBox1.Selected.displayName */ DisplayName: ComboBox1_1.Selected.DisplayName;
Email: ComboBox1.Selected.email; Department: ""; JobTitle: ""; Picture: "" } } )
The 'c:0o.c|federateddirectoryclaimprovider|' value in above formula should be replaced with the corresponding value on your side.
Please take a try with above solution, then check if the issue is solved.
Best regards,
Hi @v-xida-msft ,
thank you so much. This is just the solution I was looking for.
First of all, i did not check the "Allow selection of Groups" in the first place. Thats kind of confusing because the type of the column "Person/Groups" is implying that you can add groups with no further configuration. But Ok.
The other problem was of course, that i had no idea what value "Claims" should have.
Again. Thank you very much.
Another task of the app should be (on a different screen) to check if a specific User is in a group. For Example a User named "John" is in the group "Swimmers". How do i check if "John" is in this group on a button click?
Cheers,
Felix
User | Count |
---|---|
124 | |
87 | |
87 | |
75 | |
69 |
User | Count |
---|---|
215 | |
181 | |
140 | |
97 | |
83 |