cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kiranshegde
Level: Powered On

Patch function not working with local data source

I have created a mobile app which connects to the local datasource (Static data in your app). The name of the data source is "Table1" which contains a list of guests who attend to a show. I have added an overview screen which contains a gallary to display the list of guests. Each item of the gallery contains the name and other inoformation of the guest. I have added a toggle control to the gallery item. As soon as the user changes the toggle value, it has to update one of the column "CardPickedup" to the selected value of the toggle control for the respective item in the gallery. For this I have used Patch command as below.

 

Toggle1.OnChange = Patch(Table1,ThisItem,{CardPickedUp:Toggle1.Value})

Powerapps shows an error saying that "The first argument of 'Patch' should be a collection", highlighting "Table1". I tried the same function in the other screens, but always I get this error. I am not sure how to solve this.

 

Just for a test I added another data source which connects to a google sheet with the same data set and just changed the first argument to the new data source. This works fine and update works properly, but not working only when I connect to the local data source.

Can anyone please help?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
PowerApps Staff irinak
PowerApps Staff

Re: Patch function not working with local data source

Hi Kiran,

 

Please consider using Common Data Service for your app. That will allow you to have 20,000+ records and also have the data persisted as the guests register to the event. Here is a tutorial to help you get started:

https://powerapps.microsoft.com/en-us/tutorials/data-platform-intro/

 

Best regards,

Irina

4 REPLIES 4
Community Support Team
Community Support Team

Re: Patch function not working with local data source

Hi Kiranshegde,

 

May I know that what is it that you exactly mean by "connect to local datasource"? There is no such connection in powerapps so far. Please help to confrim this.

 

Regards,

Mona

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
PowerApps Staff irinak
PowerApps Staff

Re: Patch function not working with local data source

Hi kiranshegde,

 

As I understand, the local datasource in your case is data imported from a local Excel spreadsheet. That data is static and cannot be updated through Patch. Do you need to save the data between app sessions? If so, then please use a non-static data source. If you don't need to save the data updates between app sessions, then you can copy that data into a local collection using Collect function and do Patch on that.

 

Best regards,
Irina

kiranshegde
Level: Powered On

Re: Patch function not working with local data source

Hi Irina,


Thank you for your answer. You are correct that I imported data from an excel spreadsheet to the app. My scenario is like this.
- The app will be used by an onsite host for an event at the onsite desk.
- He gets the list of registrations through some other database as an excel.
- I imported the data to the app as local data source.
- The app user (onsite host) can see all the registrations (guests) in a list in the PA app.
- As soon as a guest arrives, he marks the guest as attended. For this he has to update the Attended column of the spreadsheet to true. I am using Patch command for this purpose.
- After the end of the event, the app user exports the data for the update of the orininal system.

 

I tried to achieve the same functionality by using the connection to google spreadsheet. But PA seems to support only 500 records while connecting to google spreadsheet. We have around 20,000 records for each event. What would be the best approach to handle this requirement?

 

Thank you

Kiran

Highlighted
PowerApps Staff irinak
PowerApps Staff

Re: Patch function not working with local data source

Hi Kiran,

 

Please consider using Common Data Service for your app. That will allow you to have 20,000+ records and also have the data persisted as the guests register to the event. Here is a tutorial to help you get started:

https://powerapps.microsoft.com/en-us/tutorials/data-platform-intro/

 

Best regards,

Irina

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 52 members 4,686 guests
Please welcome our newest community members: