Skip to content
LearningPathX
Learning PathsFree TestsExam InfoHow it worksNews
Sign inChoose a certification
  1. Home/
  2. Certifications/
  3. AB-400/
  4. AB-400 Learning Path/
  5. Study FAQs/
  6. How do I transform a custom connector response without masking an API failure?

Study FAQ

How do I transform a custom connector response without masking an API failure?

Exam · AB-400Knowledge domain · Develop integrations (10–15%)Updated Nov 25, 2026
Also asked as 2
  • How can custom connector C# code flatten a successful response and preserve backend errors?
  • What should connector code return when a successful HTTP response has the wrong shape?

Answer

Use custom code when a policy template cannot express the response transformation. In the supported C# script, implement Script : ScriptBase and override ExecuteAsync. Forward the request with Context.SendAsync. Preserve the backend's error statuses. For a successful response, validate the shape before converting it to the consumer's documented schema. If a 200 response is missing required fields or has the wrong types, return a deliberate contract error such as 502 rather than inventing an empty success.

For example, a quote API might wrap its result in result. Validate that the inner quote ID, numeric cost, and currency meet the exposed contract before returning the flattened fields. Restrict the code to the intended operation. If dispatch uses the operation identifier, consult the documented regional encoding issue and validate the identifier handling.

Check the supported namespaces and platform limitations. Microsoft documents one script file, .NET Standard 2.0, up to 1 MB and a two-minute ceiling on new or updated connectors. Custom code has documented gateway and virtual-network limitations, including the public endpoint path used by Context.SendAsync.

Compile against the supported interfaces, deploy to a development connector, and test valid 200, malformed success, invalid credentials, and a controlled service failure. Verify the actual downstream flow branches and output schema with code enabled.

Microsoft references

  • Use custom code in a custom connector
  • Create a custom connector from an OpenAPI definition

Full explanation

AB-400: Custom Connectors with OpenAPI, Policies and Code

Study guide · AB-400

Read the full explanation →
← Back to AB-400 FAQsView learning path →

Related questions

What proves a governed Power Platform request integration handles replay and uncertain results? →How do I use an alternate key and Upsert to synchronize Dataverse rows safely? →How do I checkpoint paged Dataverse change tracking without skipping updates? →How do I handle deletions and expired tokens in a Dataverse synchronization? →How do I match a Power Platform custom connector's authentication to the API it calls? →How do I test a Power Platform custom connector from its backend through the consuming app or flow? →
LearningPathX

A focused path to certification, one clear step at a time.

© 2026 LearningPathX. All rights reserved.

Product

CertificationsLearning PathsFree TestsHow it worksNews

Company

SubscriptionHelp centerContact usPrivacyTerms

Follow us

Your privacy choices

We use analytics cookies to understand how LearningPathX is used and improve your learning experience. Analytics will only start after you accept.