cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shaikbashu786
Level: Powered On

one of the column details should disappear in an item when the user clicks on the button

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.

 

  1. I have a button called "Remove Site Admin" When user clicks on the button their name should disappear from the  Site Admin column in an item 
  2. I also have a button called “confirm Account” when ever the user clicks on that button it should automatically need to update the Verified Column to "Yes"
 
 

I would really appreciate your help thanks in advance.

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: one of the column details should disappear in an item when the user clicks on the button

@shaikbashu786

#1 OnSelect property of Remove Site Admin button

Patch(
your_datasource_name,
SharepointIntegration.Selected,
{‘Site Admin’: Blank()}
)

#2 OnSelect property of Verified button.

Patch(
your_datasource_name,
SharepointIntegration.Selected,
{Verified: true}
)

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

View solution in original post

Community Support Team
Community Support Team

Re: one of the column details should disappear in an item when the user clicks on the button

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

9 REPLIES 9
Super User
Super User

Re: one of the column details should disappear in an item when the user clicks on the button

@shaikbashu786

#1 OnSelect property of Remove Site Admin button

Patch(
your_datasource_name,
SharepointIntegration.Selected,
{‘Site Admin’: Blank()}
)

#2 OnSelect property of Verified button.

Patch(
your_datasource_name,
SharepointIntegration.Selected,
{Verified: true}
)

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

View solution in original post

shaikbashu786
Level: Powered On

Re: one of the column details should disappear in an item when the user clicks on the button

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

Community Support Team
Community Support Team

Re: one of the column details should disappear in an item when the user clicks on the button

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Super User
Super User

Re: one of the column details should disappear in an item when the user clicks on the button

@v-xida-msft 

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()
         }
   )
)

 

Highlighted
Super User
Super User

Re: one of the column details should disappear in an item when the user clicks on the button

@shaikbashu786 

Which solution from @v-xida-msft worked for you?  I couldn't get it to work for Site Admin.

shaikbashu786
Level: Powered On

Re: one of the column details should disappear in an item when the user clicks on the button

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.

shaikbashu786
Level: Powered On

Re: one of the column details should disappear in an item when the user clicks on the button

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.

Super User
Super User

Re: one of the column details should disappear in an item when the user clicks on the button

@shaikbashu786 

It all makes sense now.  Thank you for replying and informing me.

shaikbashu786
Level: Powered On

Re: one of the column details should disappear in an item when the user clicks on the button

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. 

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,912)