Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Error Handling
Answered

Getting error message when the power app page is published but there is no error when ran from power app studio

(0) ShareShare
ReportReport
Posted on by 36

Hi All,

    I have a power app page where I have the following code

 

If(
 IsError(
 CustomerConnectorFunc.SaveSyncConfig(
 {
 code: LookUp(
 'Environment Variable Values',
 'Environment Variable Definition'.'Display Name' = "Save Sync Config Function Key"
 ).Value,
 partitionKey: "US",
 ClientId: tbx_ClientId.Value,
 ClientSecret: tbx_ClientSecret.Value,
 CRMUrl: tbx_CrmUrl.Value,
 WebApi: tbx_WebAPIUrl.Value,
 WebAPIUrl: tbx_WebAPIUrl.Value,
 OrganizationId: tbx_OrgId.Value,
 TenantId: tbx_TenantId.Value
 }
 )
 ),
 Notify(
 "Error while saving the details to Service.Please try again later.",
 Error
 ),
 Notify(
 "Details saved successfully!",
 Success
 )
 )

 

Here, the CustomConnectorFunc is a custom connector that calls an Azure Function. The Azure function returns HTTP status ok on success otherwise a 500 Error status. When I am running this page from power app studio and I hit the save button, the function executes appropriately giving a success message. When I run this page from the published app in the same environment, this gives the error message shown in the above code. But at the same time the API call is successful as I can see the azure function is returning an HTTP status ok. I tried adding application insight to the page - but that did not show any error. Any help would be appreciated. 

Categories:
  • Verified answer
    Tiklu Ganguly Profile Picture
    36 on at
    Re: Getting error message when the power app page is published but there is no error when ran from power app studio

    Ok, apparently the code was behaving this oddly as it is expected from the custom connector to either return a boolean value or a JSON object. Now my function was doing none of those. Once I changed the function the problem went away

  • Tiklu Ganguly Profile Picture
    36 on at
    Re: Getting error message when the power app page is published but there is no error when ran from power app studio

    So in simple, when I am running the code by pressing the play button from the power apps studio the application is running as expected and not going to an error condition in the IsError formula. But when the app is published and running in the same environment, it goes to the error condition. 

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Error Handling

#1
stampcoin Profile Picture

stampcoin 35

#2
DS-11051211-0 Profile Picture

DS-11051211-0 14

#3
HumanOnly Profile Picture

HumanOnly 6

Overall leaderboard

Featured topics