Hi
I have created a list with 7 columns and in all items view I'm displaying all the columns. There is a column called Site Admin (Person or Groups Field) I'm displaying all the Site Admin in the list for all the items through pro-grammatically and also have Verified Column (Check box Field) When the user clicks on the edit item it will take to the Power Apps customized form.
In the form I'm not showing the Site Admin and Verified Columns.
So here is the tricky part I'm facing.
I would really appreciate your help thanks in advance.
Solved! Go to Solution.
Hi @shaikbashu786 ,
Could you please share a bit more about your scenario?
Do you want to remove yourself from the "Site Admin" column in an item when you press the "Remove Site Admin" button?
Further, have you enabled "Allow multiple selections" option for "Site Admin" column in your SP List?
I have made a test on my side, please consider take a try with the following workaround:
Firstly, please turn on the "Formula-level error management" option within Advanced settings of App settings of your app.
1. If you have enabled "Allow multiple selections" option for "Site Admin" column in your SP List:
Set the OnSelect property of the "Remove Site Admin" button to following:
Set(ExistingUsers, SharePointIntegration.Selected.'Site Admin');
Patch(
'Your SP List',
SharePointIntegration.Selected,
{
'Site Admin': Blank()
}
);
Patch(
'Your SP List',
SharePointIntegration.Selected,
{
'Site Admin': Filter(ExistingUsers, Email <> User().Email)
}
)
2. If you do not enable "Allow multiple selections" option for "Site Admin" column in your SP List (clear the "Site Admin" column):
If(
SharePointIntegration.Selected.'Site Admin'.Email = User().Email,
Patch(
'Your SP List',
SharePointIntegration.Selected,
{
'Site Admin': Blank()
}
)
)
Note: The 2nd condition is used to clear 'Site Admin' column value if the 'Site Admin' column value is current login user.
Please consider take a try with above solution, check if the issue is solved.
Best regards,
Thanks for the solution.
#1 Button for "Site Admin" is not working as expected, but the second one is working as expected.
In there any other solution for #1 "Site Admin Button"?
Thanks in Advance
Hi @shaikbashu786 ,
Could you please share a bit more about your scenario?
Do you want to remove yourself from the "Site Admin" column in an item when you press the "Remove Site Admin" button?
Further, have you enabled "Allow multiple selections" option for "Site Admin" column in your SP List?
I have made a test on my side, please consider take a try with the following workaround:
Firstly, please turn on the "Formula-level error management" option within Advanced settings of App settings of your app.
1. If you have enabled "Allow multiple selections" option for "Site Admin" column in your SP List:
Set the OnSelect property of the "Remove Site Admin" button to following:
Set(ExistingUsers, SharePointIntegration.Selected.'Site Admin');
Patch(
'Your SP List',
SharePointIntegration.Selected,
{
'Site Admin': Blank()
}
);
Patch(
'Your SP List',
SharePointIntegration.Selected,
{
'Site Admin': Filter(ExistingUsers, Email <> User().Email)
}
)
2. If you do not enable "Allow multiple selections" option for "Site Admin" column in your SP List (clear the "Site Admin" column):
If(
SharePointIntegration.Selected.'Site Admin'.Email = User().Email,
Patch(
'Your SP List',
SharePointIntegration.Selected,
{
'Site Admin': Blank()
}
)
)
Note: The 2nd condition is used to clear 'Site Admin' column value if the 'Site Admin' column value is current login user.
Please consider take a try with above solution, check if the issue is solved.
Best regards,
I have tested this code but it does not appear to work. This is likely because 'Site Admin' is a Person field. Do you know how to clear that field without using MS Automate?
If( SharePointIntegration.Selected.'Site Admin'.Email = User().Email, Patch( 'Your SP List', SharePointIntegration.Selected, { 'Site Admin': Blank() } ) )
Which solution from @v-xida-msft worked for you? I couldn't get it to work for Site Admin.
Hi @v-xida-msft ,
I tested it and worked, now i would able to remove myself with the button click 🙂
Thanks a lot with the quick turn around on my question.
Thanks and have a great week ahead.
Yes, actually in the first message i didn't provide you the proper info. But @v-xida-msft assumed my scenario and provided the formula, but from my end it worked fine.
Thanks to both of you for finding the solution.
It all makes sense now. Thank you for replying and informing me.
Hi @v-xida-msft & @mdevaney
Is there a way to remove all the "Site Admins" from the Column with the current logged in user on one button click?
I'm Using the first scenario for the solution you provided.
Thanks in Advance.
User | Count |
---|---|
252 | |
106 | |
94 | |
50 | |
39 |