cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nicolagmay
Frequent Visitor

Patching Record in Gallery: ThisItem returning an error "Column does not exist" ...but column is existing in datasource!

Hi Guys,

I have the following patch formula saved on a Save Icon within a Gallery:  Patch('CN FX Imports Tracker', ThisItem, {Remarks: TextInput1.Text}). It used to work wonders until I updated my collection to pull out more than 2000 line items. Initially, I was working with my SP list (CN FX Imports Tracker) as my gallery datasource. However, I noticed that I was not pulling records beyond 2000 rows. So I followed some guide and used Microsoft Flow PowerAutomate to pull all data records first and throw back the consolidated result to PowerApps. I then collected that data into a collection (let's put it as 'New FX Imports Tracker') and can confirm to see all records beyond 2000 rows now. However, when I updated the gallery to this new collection, my patch function is now returning an error message in the ThisItem line saying 'Some column is not existing'.

 

However, I'm pretty sure that the column it's saying is existing. I created 2 datatables using the SP list (CN FX Imports Tracker) and another one using the New FX Imports Tracker, pulled out the column, and I can definitely see the data for both, so it's not missing! Now, if I update my Patch function to put the 'New FX Imports Tracker' as the datasource, the error disappears! BUT, i want to patch the SP list directly instead, not my collection. Below are some pictures:

 

nicolagmay_0-1594049776563.png

 

My Data for your information

Sharepoint List - CN FX Imports Tracker

Collection (for more than 2000 rows) - New FX Imports Tracker

What I want to do: Patch a single record (column) directly to my SP list

Gallery Datasource before issue: CN FX Imports Tracker

Patch Function that was previously working - Patch('CN FX Imports Tracker', ThisItem, {Remarks: TextInput14_1.Text})

Gallery Datasource with issue: New FX Imports Tracker

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @nicolagmay ,

Do you set your app like this?

Gallery's Items: New FX Imports Tracker

the button's OnSelect inside the gallery: Patch('CN FX Imports Tracker', ThisItem, {'AP/AFF's Remark': TextInput14_1.Text})

If so, the reason why you get that error message is that:
The patch's data source is 'CN FX Imports Tracker'.

"ThisItem" in the gallery represent a record of New FX Imports Tracker.

So "ThisItem" does not point to the same data source as the first parameter.

 

Please make sure that: the patch function's first parameter and second parameter should point to the same data source.

 

If you insist making the gallery's Items to  New FX Imports Tracker, then you need to filter get the related record of 'CN FX Imports Tracker' when patching.

The patch function should be like this:

Patch('CN FX Imports Tracker', LookUp('CN FX Imports Tracker',ID=ThisItem.ID), {'AP/AFF's Remark': TextInput14_1.Text})

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yutliu-msft
Community Support
Community Support

Hi @nicolagmay ,

Do you set your app like this?

Gallery's Items: New FX Imports Tracker

the button's OnSelect inside the gallery: Patch('CN FX Imports Tracker', ThisItem, {'AP/AFF's Remark': TextInput14_1.Text})

If so, the reason why you get that error message is that:
The patch's data source is 'CN FX Imports Tracker'.

"ThisItem" in the gallery represent a record of New FX Imports Tracker.

So "ThisItem" does not point to the same data source as the first parameter.

 

Please make sure that: the patch function's first parameter and second parameter should point to the same data source.

 

If you insist making the gallery's Items to  New FX Imports Tracker, then you need to filter get the related record of 'CN FX Imports Tracker' when patching.

The patch function should be like this:

Patch('CN FX Imports Tracker', LookUp('CN FX Imports Tracker',ID=ThisItem.ID), {'AP/AFF's Remark': TextInput14_1.Text})

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

You are a life saver!

Although this is weird, because before I created my new collection with over 2000 rows, I was already using another collection (TableValue) with the CN FX Imports Tracker as the data source. The TableValue was the Gallery's Item and the old patch function was working flawlessly! This is the reason I never thought that having a different data source in the patch would have been the issue.

 

Anyways, I updated my patch function with yours and it has worked!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,128)