0

I setup an external service to execute a Post callout through a Flow Action. The problem is I can't set the input in the action to an Apex-Defined variable which has two variables nested in it.

I have the following Service Schema JSON to an External Service:

{
  "openapi": "3.0.1",
  "info": {
    "title": "cuustomTitle",
    "description": "",
    "version": "1.0"
  },
  "paths": {
    "/api/path": {
      "post": {
        "description": "",
        "operationId": "myOperationId",
        "parameters": [{
          "name": "county_of_residence",
          "in": "query",
          "required": false,
          "allowEmptyValue": false,
          "schema": {
            "type": "object",
            "properties": {
              "county_state": {
                "type": "string"
              },
              "county_name": {
                "type": "string"
              }
            }
          }
        }],
        "responses": {
          "2XX": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                          "county_of_residence": {
                          "type": "object",
                          "properties": {
                            "county_state": {
                              "type": "string"
                            },
                            "county_name": {
                              "type": "string"
                            }
                          }
                        },
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

I am using in : 'query' instead of 'Body' in the parameters because I have dozens of parameters being assigned in the Flow and set in the Action, and I find it cleaner to maintain this way.

I created my Flow variable: enter image description here

Assigned as such, where County is picked from a text-valued picklist, and State is also text data type:

enter image description here

In my Action Parameters, I get the following error:

enter image description here

The system receiving the API call has the schema built this way, so County and State must be embedded in county_of_residence for a successful call. Has anyone done anything similar before? Thanks!

1
  • Set it to a single variable that contains the concatenated or however country and state. You can build that variable in your flow prior to the callout.
    – identigral
    Commented Feb 13 at 21:07

0

You must log in to answer this question.