0

So I'm trying to call an external API using a Flow, so I added everything I needed to get the connection set: auth provider, named credential and external service. So far so good, connection is established, user is authenticated and api end point is reached.

My problem now is that I can't get the API schema in a way that the external action allows me to send individual parameters as the body of the request. I need to send an ID and a string, but because these are inside a json object, salesforce only shows me a "body" input, and nothing that I plug in there will work due to incompatible "types".

I've used online OpenAPI editors to try different ways to declare the body contents and format, and in Swagger everything looks fine.

This would probably be solved using an Apex class, but the purpose was to be able to depend on the Flow alone and not need Apex.

Any pointers or help is much appreciated

1

1 Answer 1

0

I have had success passing parameters to External Services in flow via a "TextTemplate" variable.

  1. Create the new Variable of type TextTemplate

  2. On the edit screen for the variable, give it a name, and then define the body in the lower field. Make sure the picklist on the right is set to Plain Text, not Rich Text.

  3. Paste in your JSON:

    { "input1":"value1", "input2":"value2" }

Save.

Now in your action, in the inputs area, specify this new variable as the input...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .