web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / how to capture icon / ...
Power Apps
Answered

how to capture icon / button clicks

(0) ShareShare
ReportReport
Posted on by 30

i have a simple idea for housekeeping app.

ticks and crosses

using sql list of items 

how can i get the selection of tick or cross captured and then saved into sql

or should i do it another way?

 

gemidriver_0-1662722286515.png

 

Categories:
  • WiZey Profile Picture
    3,023 Moderator on at

    Hello @gemidriver ,

     

    Assuming you are working on a gallery which is directly linked to your datasource, you could easily use "Patch()" in the "OnSelect" of your icons.

     

    Patch(datasource, ThisItem, {Column: Value})

     

    Will you update a boolean or a text? 

  • gemidriver Profile Picture
    30 on at

    this is the example i am working with

    gemidriver_0-1662868865146.png

    result is nvarchar(50)

    i am using the gallery

    this is the current onselect

    gemidriver_1-1662868940878.png

     

  • Verified answer
    WiZey Profile Picture
    3,023 Moderator on at

    I'm not familiar with the SQL connector, but I believe "Patch()" should work properly in your case.

     

    Patch(datasource, ThisItem, {Result: "Done"})

     

    Replace "datasource" with the name of your table and "Done" with the value you wish to insert in your table.

     

     

  • gemidriver Profile Picture
    30 on at

    legend, thanks heaps - worked perfect

  • gemidriver Profile Picture
    30 on at

    another question if i may

    once i select a result for each task, and then press submit, i would like to store the user logged onto the app, the current date, the name of the level (data label on top)
    i would also need to make sure all tasks have had a result entered, how is that possible?

    gemidriver_0-1662976280807.png

     

  • WiZey Profile Picture
    3,023 Moderator on at

    The name of the current user can be obtained with "User().DisplayName".

     

    The current date can be obtained with "Today()".

     

    The name of the level... It depends. If it's a label, just use "Label.Text" to get its text.

     

    And to check if all records have a result, you can try the code below:

     

    If(
     IsEmpty(Filter(datasource, IsBlank(Result) )),
     //Do something if all records have a result,
     //Else do something if at least one record doesn't have a result
    )

     

    This code will try to retrieve all records whose "Result" is blank. If "Filter()" returns at least one result, it'll trigger the "Else" actions, otherwise it'll trigger the "Do" actions.

     

    Hope this was clear enough.

  • gemidriver Profile Picture
    30 on at

    what code is needed for the submit? to write sql, does it need patch, or do i need to use a stored procedure?

  • WiZey Profile Picture
    3,023 Moderator on at

    I'm not familiar with SQL connector, but "Patch()" should work without any issue. I suggest you try and see how it goes, and if you encounter any problem then we'll be happy to help you.

  • gemidriver Profile Picture
    30 on at

    i am trying patch again, and just trying to update date in a different table

    unsure as to waht the record is this time

    gemidriver_0-1663069869780.png

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard