cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Canvas App Patch not creating record, and no error results

I'm having several issues that cropped up during my latest published version, where features that worked before are simply not working.  For example, I am using Patch when a button's OnSelect to create a new record in my CDS database, and the record does not get created, and the Errors() function returns "empty/blank()".  When I run the app in the PowerApps designer, it works flawlessly, but after I publish the app.  I am clearing the browser cache to ensure that the latest version is running, and I am certain I have the latest version because I modified the text on my button before publishing, and the correct button text shows up.  This is only one of several errors that have crept into areas of the application that should be completely unrelated to the areas of the application I have been working on recently.

I've noticed that the most recently published version lists a PowerApps version of  3.19063.12.  However, when I run the published application and view the session details, it says I am running version 3.19061.8. See attached screenshots :

 

Any tips on what could be going on, with either the version issue, or with the Patch function call that is not returning any error

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @larmccoy ,

Could you please share a bit more about the Patch formula within your app?

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned, the Patch function works well on my side.

 

In addition, when I run app within my web browser, the PowerApps version is also 3.19061.8 as below:14.JPG

Note: I think this issue may not be related to PowerApps version.

 

Please consider re-create a new app based on your CDS Entity, then try your Patch formula again, check if the issue is solved. The standard format of Patch formula as below:

Patch(      /* <-- Add New record into your CDS Entity */
          'YourCDSEntity',
           Defaults('YourCDSEntity'),
           {
              Column1: "xxx",
              Column2: "xxx",
             ...
           }
)
Patch(         /** <-- Modify an existing record /
         'YourCDSEntity',
          LookUp('YourCDSEntity', 'Primary Name' = "A specific value"),   /* <-- Find the record you want to update */
         {
          Column1: "xxx",
          Column2: "xxx",
          ...
         }
)

 

In addition, if you want to add a new record into your CDS Entity, you could also consider use Collect function to achieve your needs instead of Patch function. The Collect function as below:

Collect(
           'YourCDSEntity',
            {
                Column1: "xxx",
                 Column2: "xxx",
                 ....
            }
)

Please take a try with above solution, then check if the issue is solved.

 

Also please consider run your app within other browsers or Mobile device, then check if the same issue still exists.

 

Best regards,

Community Support Team _ Kris Dai
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

1 REPLY 1
Community Support
Community Support

Hi @larmccoy ,

Could you please share a bit more about the Patch formula within your app?

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned, the Patch function works well on my side.

 

In addition, when I run app within my web browser, the PowerApps version is also 3.19061.8 as below:14.JPG

Note: I think this issue may not be related to PowerApps version.

 

Please consider re-create a new app based on your CDS Entity, then try your Patch formula again, check if the issue is solved. The standard format of Patch formula as below:

Patch(      /* <-- Add New record into your CDS Entity */
          'YourCDSEntity',
           Defaults('YourCDSEntity'),
           {
              Column1: "xxx",
              Column2: "xxx",
             ...
           }
)
Patch(         /** <-- Modify an existing record /
         'YourCDSEntity',
          LookUp('YourCDSEntity', 'Primary Name' = "A specific value"),   /* <-- Find the record you want to update */
         {
          Column1: "xxx",
          Column2: "xxx",
          ...
         }
)

 

In addition, if you want to add a new record into your CDS Entity, you could also consider use Collect function to achieve your needs instead of Patch function. The Collect function as below:

Collect(
           'YourCDSEntity',
            {
                Column1: "xxx",
                 Column2: "xxx",
                 ....
            }
)

Please take a try with above solution, then check if the issue is solved.

 

Also please consider run your app within other browsers or Mobile device, then check if the same issue still exists.

 

Best regards,

Community Support Team _ Kris Dai
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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (13,466)