cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
milky_bar_may
Helper IV
Helper IV

Gallery Issue Checkbox

Hi Everyone! 

 

I have a gallery with checkboxes. 

 

The user selects the checkbox and then there is a button outside the screen to patch it through to my sharepoint list. 

 

I want to block off the row in the gallery with a rectangle so the user cannot action the item again.

 

I tried using the group function but it blocks off all the items in the galler.y

 

Thanks

 

D

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi@milky_bar_may,

 

Based on the issue you mentioned, do you want to disable the checkbox once it is checked.

I assume that the CheckBox has the corresponding values to a column in your SP list. And you want to avoid repeating patch CheckBox value. On this premise, I have a test on my side, please take a try as below:

  • Set the Default property of your CheckBox as below:
If(Gallery1.DisplayMode=DisplayMode.Edit,false,true)
  • Set the OnCheck property of your CheckBox as below:
If(Checkbox2.Value=true,DisplayMode.Disabled,DisplayMode.Edit)

As an alternative solution, you can also set the rectangle visible property as below:

If(Checkbox2.Value=true,true,false)

 

Best Regards,

Qi Qiao

Best Regards,
Qi

View solution in original post

6 REPLIES 6
Drrickryp
Super User
Super User

Hi @milky_bar_may 

Use your rectangle idea but make is visible property Checkbox1.Value

Try this:

At the beginning of the UnCheck of the CheckBox:

Collect(DisableCheck, ThisItem.ID)
 
Then on the Displymode of the CheckBox:
If(ThisItem.ID in DisableCheck, DisplayMode.Disabled, DisplayMode.Edit)
 
Or
if you want to use the visible
If(ThisItem.ID in DisableCheck, false, true)
------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
v-qiaqi-msft
Community Support
Community Support

Hi@milky_bar_may,

 

Based on the issue you mentioned, do you want to disable the checkbox once it is checked.

I assume that the CheckBox has the corresponding values to a column in your SP list. And you want to avoid repeating patch CheckBox value. On this premise, I have a test on my side, please take a try as below:

  • Set the Default property of your CheckBox as below:
If(Gallery1.DisplayMode=DisplayMode.Edit,false,true)
  • Set the OnCheck property of your CheckBox as below:
If(Checkbox2.Value=true,DisplayMode.Disabled,DisplayMode.Edit)

As an alternative solution, you can also set the rectangle visible property as below:

If(Checkbox2.Value=true,true,false)

 

Best Regards,

Qi Qiao

Best Regards,
Qi

The If() is unnecessary since Checkbox1.Value reduces to either true or false and that answers your question as you posed it.

KroonOfficeSol
Resident Rockstar
Resident Rockstar

@milky_bar_may  You say there is a button to patch() the collection to the SharePoint list. This presumed that you first do an action on the datasource and after the update you don't want the user to be able to make another patch(0 on this record, is this right.

 

So my first question should be: what do you change in your Sharepoint list? Then my advise would be to refresh your gallery/datasource and make a condition on ThisItem.ChangedField which is on the Checkbox.Visible. No Checkbox for the record, means the user isn't able to click it, right.

 

Hope this helps.

Sorry for the delayed response everyone. I appreciate all your comments. 

 

Thanks @v-qiaqi-msft , your solution worked out for me. 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (3,663)