Author Message
VasilyL
Joined: Jul 11, 2016
Messages: 230
Offline
And one more question.

There is an operation "Parse".
The question here is: why it is not possible to specify a destination variable as a field in a complex variable?
Nowadays only a simple variable can be used as a destination variable.
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
The parse operation return a collection of single values. Assign the collection to a complex variable of more than one field wouldn't make sense.
VasilyL
Joined: Jul 11, 2016
Messages: 230
Offline
Hi,

Seems that I was not clear enough.

Example.
I have a complex variable "grocery" with fields "fruits", "vegetables", "berries":
grocery
fruits
vegetables
berries

I receive an answer from a webservice like:
fruits: apple, orange, grape
vegetables: potato, tomato, pepper
berries: strawberry, blackberry

I can create and parse web service answer to three simple variable, like grocery_fruit, grocery_vegetables, grocery_berries.
But I want to keep all the data in one complex variable. So, I want to parse web service answer and put data in according field of complex variable.

So, this is the case.
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
The parse function basically expects an input of one string which has a list of items concatenated with a delimiter, for example - apple,orange,grape. It would return a 1-dimensional array/collection [apple, orange, grape]. Now, parse function will stuff this array to a variable collection. It only makes sense for a simple variable because a collection of a complex variable would be a 2-dimentional array. I understand you are thinking of a 2-dimemsional array because of the data you are expecting from the web service but you have to use more operations to put the data into the complex variable. It is more of a manual process.
Go to:   
Mobile view