Page 1 of 1

Getting array values in response mapping.

Posted: Tue Jan 29, 2013 3:12 pm
by Jon Crump

I have a similar question to this:

https://getsatisfaction.com/tiggzi/to...

I have a REST response that looks like this, please see this link for the XML response : http://confluence.jetbrains.com/displ...

When the response is mapped in Tiggzi it's changed into an array of fields:

Image

What's the easiest way to get the value of certain fields?
pseudo code:
$fields['summary'].value would return "new issue"

Can something be done in JS on the mapping?


Getting array values in response mapping.

Posted: Tue Jan 29, 2013 4:50 pm
by maxkatz

[quote:]
When the response is mapped in Tiggzi it's changed into an array of fields:

It's set up this way because that's the structure of the XML. It's possible to edit the response structure if you go to the service, Response tab. [/quote]


Getting array values in response mapping.

Posted: Tue Jan 29, 2013 5:08 pm
by Jon Crump

Yep I understand that and have tried to edit the items within the mutliple levels of the array, but when you add an item it always go to the top level of the array. How can you add items of deeper levels?

Also I'm okay with it being an array, but how is it possible to access items in the array other than the first one?


Getting array values in response mapping.

Posted: Tue Jan 29, 2013 5:35 pm
by maxkatz

Press [+] not at the top, but on the level where you want to add a new item.

Use value1.value2 or if an array value1[x].value2


Getting array values in response mapping.

Posted: Tue Jan 29, 2013 6:19 pm
by Jon Crump

I've tried replacing the response with values but that doesn't work.

So where in the mapping can I access the array values?
Drag and drop from the left to the right.

You can't map an array to a label.


Getting array values in response mapping.

Posted: Tue Jan 29, 2013 7:30 pm
by maxkatz

Array has to be mapped to a component such a grid, list, etc. Then, what's inside the array can be mapped to components inside the grid, list, etc.