Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Click on button show check icon in Gallery

(1) ShareShare
ReportReport
Posted on by

Hi,

 

I'm trying to create a code, when click on a button it will show check icon in Gallery.

I hope you can help me in this matter.

 

kinghnvn_1-1637745261341.png

Thanks.

 

 

Categories:
  • Verified answer
    kinghnvn Profile Picture
    kinghnvn on at
    Re: Click on button show check icon in Gallery

    @StalinPonnusamy 

     

    I think I found the solution 🙂

     

    If click on the button -> add new record: CheckInButton = Yes

    Set the Visible property of Icon to ThisItem.CheckInButton = "Yes"

  • kinghnvn Profile Picture
    kinghnvn on at
    Re: Click on button show check icon in Gallery

    @StalinPonnusamy 

     

    if I press F5 to refresh app or close the app and open it again, the icon will be hidden. that is incorrect...

  • Re: Click on button show check icon in Gallery

    Hi @kinghnvn 

     

    I believe I found the solution that you were originally looking for

     

    Set the OnSelect property of the Button to

    If(Not(ThisItem.ID in ColItemSelected),Collect(ColItemSelected, {ID:ThisItem.ID}))

    Set the Default property of Checkbox to

    ThisItem.ID in ColItemSelected.ID

     

    If you want to use Check Icon then Set the Visible property of Icon to

    ThisItem.ID in ColItemSelected.ID

     

    Result

    StalinPonnusamy_0-1637819093979.png

     

    Note:

    1. We can use either CHeckbox control or Icon

    2. Set Onvisible property of the screen to

    Clear(ColItemSelected)


    Thanks,
    Stalin - Learn To Illuminate

  • kinghnvn Profile Picture
    kinghnvn on at
    Re: Click on button show check icon in Gallery

    Hi @StalinPonnusamy 

     

    I want to use a check icon, can I do same the steps?

     

    kinghnvn_0-1637815103811.png

     

  • Re: Click on button show check icon in Gallery

    Hi @kinghnvn 

     

    I'm not sure what you are trying here but with the gallery, we have 2 possibilities

     

    1. Check the icon for the selected item/row

    • Set the OnSelect property of the button to

     

     

    UpdateContext({varCheckIcon:true})

     

     

      • Set Default Property of Checkbox to

     

     

    varCheckIcon && ThisItem.IsSelected

     

     

      • Result

    StalinPonnusamy_0-1637814587803.png

     

    2. Check all items in the gallery

    Set the Default property of Checkbox to

     

     

    varCheckIcon

     

     

    Result

    StalinPonnusamy_1-1637814621351.png

     

    If you want the second option then the button should be outside the gallery. 


    Thanks,
    Stalin - Learn To Illuminate

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,304

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard