Jon Crump
Posts: 0
Joined: Tue Dec 11, 2012 8:34 pm

Getting array values in response mapping.

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?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Getting array values in response mapping.

[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]

Jon Crump
Posts: 0
Joined: Tue Dec 11, 2012 8:34 pm

Getting array values in response mapping.

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?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Getting array values in response mapping.

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

Jon Crump
Posts: 0
Joined: Tue Dec 11, 2012 8:34 pm

Getting array values in response mapping.

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.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Getting array values in response mapping.

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.

Return to “Issues”