Handle array of nameless values in Web service Method-setup

I'm getting a reply such as this JSON

        "company_naics_code": [
            "3271201",
            "3332491",
            "327213",
            "333249",
            "3339930",
            "3333187"
        ],

I've linked the propper array (see pictures), but the "3271201" value and so on are not saved to any parameter.

https://prnt.sc/1rli55a

https://prnt.sc/1rli5ii

How do I handle these values in the Web service method page? Surely, I need to use some nested parameter to use the retrieved vaules. But how do I format my Path to element (JSONPath) corrently when they dont have a name?

Like 1

Like

1 comments
Best reply

It's better to deserialize the JSON string directly inside the business process or the logic that you will use when calling the web service and then substruct needed values and pass them to either process parameters or use them according to your needs. Something like this in C#:

or (in case something should be performed from the client side):

If you are going to use the web-service inside the business process don't forget to add Newtonsoft.Json.Linq using in the process properties.

It's better to deserialize the JSON string directly inside the business process or the logic that you will use when calling the web service and then substruct needed values and pass them to either process parameters or use them according to your needs. Something like this in C#:

or (in case something should be performed from the client side):

If you are going to use the web-service inside the business process don't forget to add Newtonsoft.Json.Linq using in the process properties.

Show all comments