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

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
Highlighted
Community Support Team
Community Support Team

Re: Canvas App Patch not creating record, and no error results

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
Highlighted
Community Support Team
Community Support Team

Re: Canvas App Patch not creating record, and no error results

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
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (2,041)