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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch & Collect functi...
Power Apps
Answered

Patch & Collect functions no longer working

(0) ShareShare
ReportReport
Posted on by

Good afternoon,

 

I have been developing an Application within PowerApps for a number of weeks now. Since the middle of last week, my patch function no longer works on my mobile devices, however this issue only persists within this specific PowerApp application

 

The code in question, which is on the "on select" for a button, looks like the following:

Patch('Data source',{Title:"Title field",FarmCode:"123",TicketNumber:"12654",Tonnes:16,Tipping_x0020_Point:623})

 

When i run this application from within PowerApps desktop, it patches the information to the data source. When i run the same app from my mobile device (testing on Android Tab A and an iPhone 6S) the button does not work.

If i then build a new application, add the same code as above to a new button, I am able to run it on all devices.

 

What changes could I have made to my App that would stop this from working?

All the other code within my app works correctly on all devices other than when patching / collecting to a live data source from a mobile device.

 

Any help would be appreciated

Thanks in advance,

Jason Dennehy

Categories:
I have the same question (0)
  • v-micsh-msft Profile Picture
    on at

    Hi @Anonymous,

     

     

    I think there should be something missing with the formula you posted.

    Basically the path function would contain three elements:

    Patch ( Datasource,

                BaseRecord,

                ChangeRecord

               )

    While the formula you used here is missing the BaseRecord part.

    Patch('Data source',{Title:"Title field",FarmCode:"123",TicketNumber:"12654",Tonnes:16,Tipping_x0020_Point:623})

    Would you please check it again and then update the formula here ?

    Adding the patch function reference:

    Patch function in PowerApps

     

    Regards,

    Michael

     

  • Community Power Platform Member Profile Picture
    on at

    Hi Michael (@v-micsh-msft)

     

    Thanks for the reply. In this instance, I'm not attempting to amend a record, I'm trying to add a new record into the data Source (SharePoint list). The formula has been working up until now and still works when I run it within PowerApps desktop.

     

    I can interchange the formula to Collect and the issue still exists, By which I mean the formula would then be:

    Collect('Data Source',{Title:"Title field",FarmCode:"123",TicketNumber:"12654",Tonnes:16,Tipping_x0020_Point:623})

     

    The odd thing is, I can create a new app from the same data source, copy both the collect and patch formulas onto separate buttons and then they both work on all devices.

     

    Again, thanks for your response.

    KInd regards,

    Jason Dennehy

  • Tom_Slosse Profile Picture
    1,430 on at

    Hey @Anonymous

     

     

    To create a new record you should use the follwing in your Patch function

     

    Patch(<datasource>, Defaults(<datasource>), {...})

     

    The defaults function will create a new record in your sharepoint list.

     

    Hope this helps

     

    Kind regards

     

     

    Tom

  • Community Power Platform Member Profile Picture
    on at

    Hi @Tom_Slosse,

     

    Thanks for the message.

    Even if I add the 'Defaults' into the formula, my mobile device will not add a record into the SharePoint list. Pressing the same button on the desktop version of PowerApps successfully adds the record.

     

    It's very strange, as I haven't made any changes to the code that I was using (without the 'defaults') line, and it was working perfectly. Then a couple of days ago, it just stopped.

     

    Cheers,

    Jason

  • Tom_Slosse Profile Picture
    1,430 on at

    Hey @Anonymous

     

     

    That's indeed very odd. 

    I will look into my app if it does the same.

    I will let you know what my outcome is.

     

    Maybe Collect and Patch are fighting eachother, try one of both and see if that helps? (just suggesting things here :p)

     

    Kind regards

     

     

    Tom

  • Community Power Platform Member Profile Picture
    on at

    Hi @Tom_Slosse,

     

    I absolutely appreciate any suggestion that you might have, as I'm out of them!

    I've separated the Patch and collect functions into separate buttons, which hasn't helped.

     

    The only additional information I can think of is that I added another data source (Different SharePoint list) and I was in the process of rewriting a couple of Timers when the issue began - though none of which interacted with the "Submit" button which held the code that no longer works.

     

    Thanks again!

    Kind regards,

    Jason

  • Tom_Slosse Profile Picture
    1,430 on at

    Hey @Anonymous

     

     

    I just added some records in my sharepoint list with Patch so I don't think that function is the problem.

     

    My scenario is I get information from one SP list and I patch it into another one so a bit simular to your set up right.

    What I should try if I were you (time consuming tho and annoying) is try to reset your timers to what they were before and see if thats the problem.

     

    Kind regards

     

     

    Tom

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    Hi @v-micsh-msft & @Tom_Slosse

     

    I've figured out what the problem was. I had made a change to the SharePoint list which is the data source for the App.

    Within powerApps desktop, when ever I opened the app to edit, there were errors that could be resolved by "refreshing" the data source. I had to do this every time I launched the application from scratch.

     

    As far as I can see, the mobile devices do not have this capability, which is why it was no longer working.

    To resolve - I removed the data source and reconnected to my SharePoint list, which has resolved the issue.

     

    Not sure if this is intended but if anyone see's an error like this, I hope the above helps.

     

    Kind regards,

    Jason

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard