Extract Data from API response string

I am working on a custom activity where i use some API and get the following response:
response.content = [4,[“XYZ”,“PQR”,“ABC”,“TUV”],null,[[“XYZ”,“Description of XYZ”],[“PQR”,“Description of PQR”],[“ABC”,“Description of ABC”],[“TUV”,“Description of TUV”]]]

I want to extract the output in three forms:

  1. Number of Codes matched : 4
  2. Codes matched : in form of array {“XYZ”,“PQR”,“ABC”,“TUV”}
  3. Code Description : In form of Data Table or Array
    Is there any way to get that string data in above format.

Looking forward for your response

Thanks & Regards

the response.content is in form of a string.I need to strore the codes() in an array

Hi @RishabhMathur,
If you an API response in json you to try “Deserialize JSON” or “Deserialize JSON Array” activities to get data from json files. Otherwise if its an array try using string methods.


This is not at all a JSON @RishabhMathur

I didn’t say that it’s a JSON

I do have JSON as output and I am first storing it in a variable then using deserialize activity. But couldn’t figure out the next step. For temporary i am splitting it.

Actually, for the second response, I mentioned that, the deserialize JSON will give you the error.

You can store that as a string and then split it based on the braces you have. that will be the least possible case