1

I'm using external services to do a Callout and my input parameter is an array. I'm having trouble passing a collection variable as an input to the Action on a Flow.

I imported the following Service Schema JSON to an External Service

{
  "swagger": "2.0",
  "info": {
    "description": "This is a simple API",
    "version": "2.0.0",
    "title": "Record Update API",
    "contact": {
      "email": "[email protected]"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "host": "virtserver.swaggerhub.com",
  "basePath": "/eschwarzbock5/CreateAccountAndAcontacts/2.0.0",
  "tags": [
    {
      "name": "admins",
      "description": "Secured Admin-only calls"
    },
    {
      "name": "developers",
      "description": "Operations available to regular developers"
    }
  ],
  "schemes": [
    "https"
  ],
  "paths": {
    "/account-and-contacts": {
      "post": {
        "tags": [
          "AccountAndAcontacts"
        ],
        "summary": "AccountAndAcontacts",
        "description": "Creates Accounts and Contacts",
        "operationId": "AccountAndAcontacts",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "Accounts",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Account"
              }
            }
          }
        ],
        "responses": {
          "201": {
            "description": "item created"
          },
          "400": {
            "description": "invalid input, object invalid"
          },
          "409": {
            "description": "an existing item already exists"
          }
        }
      }
    }
  },
  "definitions": {
    "Contact": {
      "type": "object",
      "properties": {
        "firstName": {
          "type": "string",
          "example": "John"
        },
        "lastName": {
          "type": "string",
          "example": "Smith"
        }
      }
    },
    "Account": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "example": "Account Name"
        },
        "contacts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Contact"
          }
        }
      }
    }
  }
}

I created the Accounts parameter on the schema definition following the suggestion here: External Services Considerations where it says "Supported Inline Array Definition with Reference to Array Items Definition".

I created my accounts variable in my flow

enter image description here

The issue I'm having is when I want to pass the variable as an input to the Action, the collection I created doesn't appear as an option:

enter image description here

Does anyone know how set the input correctly? I assume this should be possible since Salesforce details how to create the arrays definitions.

Thanks!!

1
  • I have raised a support ticket with Salesforce about this. It seems more like a platform bug than an issue with your config
    – Tim
    Commented Jun 29, 2021 at 8:51

1 Answer 1

0

Salesforce have finally confirmed this is a bug!

I had a call from support this AM (2021-07-15), they confirmed that this is going to be fixed and will be deployed in the Winter '22 Release (Sep/Oct)

https://trailblazer.salesforce.com/issues_view?id=a1p4V000002BQkPQAW

You must log in to answer this question.

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