0

I am testing External Services against the screensteps api and am successfully authenticating and returning data to the flow.

One of the nested parameters in the response appears blank to the flow, but is clearly populated when I run the same query in postman. I have tried a number of ways to debug this, and am stuck on what else to try.

What I have tried:

  • displaying the response in a screen : links object shows as { }
  • reviewed debug logs : truncates a few characters before the info I need
  • iterating over the results object in a flow loop and displaying the loopVariable.links.api_URL in a flow screen within the loop. no change - it is still blank.

Pasting the external services definition, sample output from postman, and screenshots below.

Any ideas on what else to try are appreciated. Some things that could be helpful

  • is there any way to prevent the debug log output from truncating? I have tried the raw log, the external services response is still truncated.
  • Can anyone confirm the behavior for nested objects when displaying a response in a flow screen? Is {} indicative of empty object or just a 'flow thing'?

External Services Definition

{
  "swagger": "2.0",
  "info": {
    "description": "defaultDescription",
    "version": "0.1",
    "title": "defaultTitle"
  },
  "paths": {
    "/5156/search": {
      "get": {
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "tags",
            "in": "query",
            "required": false,
            "type": "string",
            "x-example": "opportunities"
          }
        ],
        "responses": {
          "200": {
            "description": "Definition generated from Swagger Inspector",
            "schema": {
              "$ref": "#/definitions/Model0"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "Links": {
      "properties": {
        "published_url": {
          "type": "string"
        },
        "api_url": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "Results": {
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32"
        },
        "meta_description": {
          "type": "string"
        },
        "meta_title": {
          "type": "string"
        },
        "meta_search": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "links": {
          "$ref": "#/definitions/Links"
        }
      },
      "type": "object"
    },
    "Meta": {
      "properties": {
        "page_count": {
          "type": "integer",
          "format": "int32"
        },
        "total_entries": {
          "type": "integer",
          "format": "int32"
        }
      },
      "type": "object"
    },
    "Model0": {
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Results"
          }
        },
        "meta": {
          "$ref": "#/definitions/Meta"
        }
      },
      "type": "object"
    }
  }
}

Sample Response from Postman

{
    "results": [
        {
            "id": 922048,
            "meta_description": "Assign teammates to partnership teams and enable them with edit access.",
            "meta_title": null,
            "meta_search": "opportunities, partnerships, teams, edit access, ",
            "title": "Adding Opportunity Teams",
            "links": {
                "published_url": "https://ashoka.screenstepslive.com/s/salesforcehelp/m/50882/l/922048-adding-opportunity-teams",
                "api_url": "https://ashoka.screenstepslive.com/api/v2/sites/5156/articles/922048"
            }
        },
        {
            "id": 922048,
            "meta_description": "Assign teammates to partnership teams and enable them with edit access.",
            "meta_title": null,
            "meta_search": "opportunities, partnerships, teams, edit access, ",
            "title": "Adding Opportunity Teams",
            "links": {
                "published_url": "https://ashoka.screenstepslive.com/s/salesforcehelp/m/50882/l/922048-adding-opportunity-teams",
                "api_url": "https://ashoka.screenstepslive.com/api/v2/sites/5156/articles/922048"
            }
        }
etc...etc...etc..
    ],
    "meta": {
        "page_count": 1,
        "total_entries": 8
    }
}

Dev Console Log Output

16:48:47:926 EXTERNAL_SERVICE_RESPONSE ExternalServiceSchemaType:OpenApi|ExternalServiceName:ss4Mod|SystemVersion:2|Action:GET|OutputParameters:{"200":"{\"results\":[{\"id\":224325,\"meta_description\":\"\",\"meta_title\":\"\",\"meta_search\":\"\",\"title\":\"How do I send mass emails to contacts/leads in Salesforce?\",\"links\":{\"published_   <... truncated: 14100 characters ...>   |HttpResponseStatus:200

Image 1 : Displaying results in flow screen. Note that lists appears as {} response displayed on screen

0

From a pure JSON data access patterns:

results[0].links.published_url
results[1].links.published_url

So as you mentioned: "iterating over the results object in a flow loop and displaying the loopVariable.link.apiURL in a flow screen within the loop. no change - still blank. "

  1. Confirm if loopVariable is equivalent of each iteration of results[0] ,results[1] and so on.
  2. Also loopVariable.link.apiURL should have been "loopVariable.links.apiURL"
| improve this answer | |
  • Thx appreciated, have updated the parameter name on the post. Loop variable should be equivalent to 0,1,etc. Will try to get some insight from Salesforce but likely requires premier support as it's code. – gorav Jun 13 at 1:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.