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 / Using a gallery and a ...
Power Apps
Unanswered

Using a gallery and a flow to update sql

(0) ShareShare
ReportReport
Posted on by 23

Hi

 

I have a gallery in an app that pulls a list back from sql tables on our on site gateway.

 

each gallery record has a input pox where the user can input a quantity.

 

As an example there may be 100 records, I want the user to browse the gallery at a quantity to 20 records - I then want to call a sp via flows to update only those 20 records.

 

I can do it gallery record by gallery record by placing an update button on each record - but I would like a button outside of the gallery that updates all the records that have a quantity in the input box inside of the gallery.

 

Is this possible or is there a better way of doing it?

 

Thank you

 

 

Categories:
I have the same question (0)
  • Dawidvh Profile Picture
    1,346 on at

    Hi @SHEPIANG 

     

    You don't actually need flow for this.

     

    If you know which records from the gallery you want to update to SQL you can use Patch with something like. (Patch can accept multiple records as a second parameter.

    Patch(SQL,Gallery.AllItems)

     

    The trick is to know which gallery items you want to update, so you can either write the gallery item into a tmp collection if the Text Input changes, or to do a filter on the Gallery.AllItems to check for a value.

    TextInput.Onchange: 

    Collect(colItemsToPatch,ThisItem)

     

    OR something like this on patch

    Patch(SQL,Filter(Gallery.AllItems,Value(NumberInput.Text)<0))
    

     

    Let me know if you don't come right.

     

    Dawid van Heerden

    Follow on Twitter: @davestechtips

    Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1

     

    **If you found this reply helpful, please give it a thumbs up and Accept as Solution to close the topic and make it easier to find for other people with similar questions.

  • SHEPIANG Profile Picture
    23 on at

     

    Thank you for taking the time to help

     

     

    I am getting that the data source is read only 😞

     

     

  • SHEPIANG Profile Picture
    23 on at

    My connection is set up as sql server auth, and I am logged in as SA - so that account has rights to do everything ?

  • Dawidvh Profile Picture
    1,346 on at

    The SQL Table must have a primary key column, otherwise PowerApps doesn't have a way to update the records.

     

    Let me know if you don't come right.

  • SHEPIANG Profile Picture
    23 on at

    Hi

     

     

    i have set up a small test table and have inserted and edit from there.

     

    I will now move onto using the gallery - but thank you very much for putting me on track.

     

    Your help has been really appreciated.

     

    Thank you

  • Dawidvh Profile Picture
    1,346 on at

    That is great news, please keep me up to speed and if this helped you to resolve it, please mark the Answer to make it easier for other people to find the solution to similar problems.

    Have a wonderful day.

     

    Dawid van Heerden

    Follow on Twitter: @DavesTechTips

    Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1

     

    **If you found this reply helpful, please give it a thumbs up and Accept as Solution to close the topic and make it easier to find for other people with similar questions.

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 339 Most Valuable Professional

#2
11manish Profile Picture

11manish 180

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard