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 / Selecting Operation fo...
Power Apps
Unanswered

Selecting Operation for Custom Code

(3) ShareShare
ReportReport
Posted on by 23
When I select 1 or multiple operations where my custom code should be applied and save my changes by clicking the "Update connector" button, the selected operation(s) are not shown in the UI after the changes are saved. 
Through my testing I can tell that the code is only being applied for the operations I selected, however there is a problem. When no operations are selected, the code will be applied to all operations, so the next time a change is made and saved on the connector, if I don't remember to go to the "Code" page and select the correct operations again, the code will then be applied to all operations. Also, even if I do select the operation before saving it, when I export the solution with my custom connector to put it in source control or to import it to another environment, there is nothing in the export that indicates what operations were selected, so the code is applied to all operations when imported to another environment. 
 
When using policy templates instead of custom code, you can select operations in a similar way and this problem does not happen. The UI keeps the selected operation after the change is saved and the policytemplateinstances.json file has a parameter called "x-ms-apimTemplate-operationName" for policies where certain operations were selected. 
 
Has anyone else experienced this? Is there a fix or work around? Is there something similar to "x-ms-apimTemplate-operationName" that can be added to a file in an exported solution to indicate what operations the custom code should be applied to so that it won't be applied to all?
 
I know that I can write code to just pass through the request and response with no changes for operations that don't require custom code, however I've found other bugs that are introduced when running custom code. For example, if your API returns a "Location" header in the response, the URL will be re-written to get routed through the connector. However, if the "Set host URL" policy or custom code (even code that just passes through the request and response) runs for that operation, the location header value is not re-written. This causes problems if the Asynchronous Pattern is enabled, and your action returns a 202 response.
 
 
Screenshot below shows me selecting the operation for my custom code before updating the connector.
 
 
The screenshot below shows what happens after the connector is updated, it no longer shows what operations are selected.
Categories:
I have the same question (0)

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard