Continuing with the series on Custom Connector, today I touch upon output results of your actions. If you have worked with any of the existing connectors including Common Data Service connectors, you will notice that when you choose an action like List or Read, the CRM record object returns individual field values of the record as properties that you can then easily use through the Dynamic Values option further in your flow.
When creating a custom connector, say we return a JSON object as the result from the Azure function, you will notice that without any formatting, the output will appear as
The JSON object is available in the body but to read the individual properties from in there, you would need to use the expression in the form of
If the JSON result is of the form
While it is accessible through expression, it would be user friendly if we could have it available as a property that could be referenced directly as a field when listing dynamic values to choose from.
For this make sure to define the response format in your custom connector
Double click on default to open the response editor
In the import from sample window provide the JSON object of your result, to see it populate the properties automatically
With this done, now when you look for the dynamic values for your action result, you will find it in the form of
Consider scenario where your JSON result is in nested JSON format as below.
In that if any of the field names is same in the entire JSON object irrespective of whether it is in parent or child node, it will appear as duplicate properties as below.
Be careful with your properties names in the JSON object to avoid this scenario.
Make sure to set the response properties appropriately for your actions in custom connector to make it more user friendly.