6 Replies Latest reply on Sep 17, 2020 12:07 PM by LJ LongWing

    Processing REST responses with dynamic sizes

    Florian Ruehland
      Share This:

      Hello everyone,

       

      Since BMC ARS 19.08 we got the option to consume third-party REST-APIs with the Set Fields Action in Filters. However, looking at the documentation and the functionality as provided in the Dev Studio, I am left wondering how we may deal with responses of dynamic sizes.

       

      In the Response Mapping, we can set JSON-Keys to map to certain Form-Fields and also access different depths within the received JSON-Response. However, assume the following type of response:

       

      {

        "results" : [

          "result0" : "something",

          "result1" : "something else",

          "result2" : "something completely different",

          ...

          "resultN" : "something we didnt have yet"

        ],

        "some" : "thing",

        "and" : "one last thing"

      }

       

      Now if we assume exactly N results in our response we can create N fields in a form and load the date into these fields. However, what if for one execution its N elements and the next execution results in M elements? How can I ensure that these elements always land in e.g. an array or as dataset in a Form?

       

      Thanks in advance and Kind Regards