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 / Unable to use patch fu...
Power Apps
Answered

Unable to use patch function along with filter query in gallery

(0) ShareShare
ReportReport
Posted on by

I am using a gallery(Gallery1) to get the input from users in the table format. Since the rows will be dynamicaly added by the end users, there will be a button(add row) to add new row in the gallery and following function is used in the button:

Patch(Tablename,Defaults(ThisItem),{colname:"" })

But at the same time, the gallery should show only the rows entered by that particular user. Hence,the following filter query has been provided to the Gallery1:

Items = Filter(tablename, Name= User. Fullname())

But after the filter query is added to the gallery,the new row is not added in the front end while clicking the add row button, but the row is adding in the excel file.

Kindly let me know how can i apply patch and filter function for the same gallery in canvas app

Categories:
  • dave-jorgensen Profile Picture
    502 on at

    Hi Dn. Couple things. First, you are patching "Tablename" and filtering "tablename". I'm going to assume that's a typo and they are indeed the same datasource. Second, when you patch, you are not setting a field called "Name" yet you are referencing it in your filter. Again assuming you do you have a column called "Name" in your datasource, and if so, you should set that in your patch to be the user's name.

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Dn,

    Do you mean that the Gallery could not display the latest added data?

    Could you please share a bit more about your scenario?

     

    I have a test and situation is confirmed on my side, please check as below.

    Table13 is my data source, 'Pay Period' is the column where I save the name value.

    vqiaqimsft_0-1652772310257.png

    I think this could work on your side, too, please check the formula and make sure it looks like the one I provided.

    In addition, I would suggest you add a Refresh() function just behind the Patch function to manually refresh the data source.

    Patch(Tablename,Defaults(Tablename),{colname:"" });Refresh(Tablename)

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 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard