cancel
Showing results for 
Search instead for 
Did you mean: 

Web API Service with JSON Path parsing

MateuszBartczak
Level 4
Hello Everyone,

I'm struggling recently with an error generated by Web Service action that has following Json Path applied as output parameter: $..issues
  • .key

    The error thrown at the process layer is: ERROR: Internal : Unexpected error Path returned multiple tokens.

    The problem is that I indeed want to receive multiple tokens as an output, however, I have no idea how to put this in a collection or text variable...

    I will be grateful for any help.

    Thanks and Best Regards,
    Mateusz

    Edit:

    I found in documentation (v6.10 User Guide - Web APIs) the following sentence:

    If the JSONPath defined for the output parameter does not find a match in an HTTP response, the output parameter will return an empty data item/collection. If the JSONPath defined for the output parameter finds multiple possible matches in an HTTP response, an exception will be thrown in the process.

    But at the same time just right under it there is a table with json path examples that returns multiple values. I'm lost now.

    37033.png
  • 3 REPLIES 3

    steven.boggs
    Staff
    Staff
    Hi Mateusz,

    Based on the issue description, the error received, and your stated requirements in this scenario, we would suggest to open a Support ticket with us so we can investigate this further and provide our recommendations after reviewing the relevant components of this implementation. Please be sure to include the required info for new tickets so we can be best-placed to assist.

    ewilson
    Staff
    Staff
    Hi Mateusz,

    Can you post an example of the JSON content you're trying​ to parse?

    Cheers,
    Eric

    MateuszBartczak
    Level 4
    Hi Steve, Hi Eric,

    Thanks for responding.

    Here is the small part of the JSON that I'm trying to parse:

    [
      {
        "expand": "schema,names",
        "startAt": 0,
        "maxResults": 50,
        "total": 2,
        "issues": [
          {
            "expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
            "id": "600133",
            "self": "https://",
            "key": "ROBPRA-6"
          },
          
          {
            "expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
            "id": "600121",
            "self": "https:",
            "key": "ROBPRA-5"
          }
            
          ]
      }
      ]​
    By using $..issues
  • .key syntax, I should receive something like:
    [
      "ROBPRA-6",
      "ROBPRA-5"
    ]​

    But Blue Prism unfortunately can't return it as a string or put it in a collection. I assume that would be possible with some custom code but I have countless issues with newtonsoft.Json.dll...