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.
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
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.
Stay up to date on forum activity by subscribing.
stampcoin
35
DS-11051211-0
14
HumanOnly
6