Hi Everyone!
We are running into an issue when trying to parse data that comes from an HTTP GET request. As you can see in the first picture below we are parsing the "data" header that was retrieved from the HTTP request. Then we take that parsed JSON data and iterate the "rows" of the JSON to get all of the values returned to us in a way that can be used later on in the scenario. But for some reason the iterator only returns one of array indexes.
Any help on getting all of the array indexes would be greatly appreciated.
Thanks in advance!
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Data is not being interpreted as an iterable object by Fusion. Can you post an obfuscated example of what's in Data?
Views
Replies
Total Likes
Hi Chris thanks for the reply,
Here is what data looks like. I hid most of the actual data and replaced the datasourceID with DATASOURCE
"data": "{\"datasource\":\"DATASOURCE\",\"columns\":[\"AD.surname\",\"AD.givenname\",\"allLowerEmail\",\"AD.title\",\"AD.Supervisor Full Name\",\"AD.FederationID\"],\"metadata\":[{\"type\":\"STRING\",\"dataSourceId\":\"DATASOURCE\",\"maxLength\":-1,\"minLength\":-1,\"periodIndex\":0,\"aggregated\":false},{\"type\":\"STRING\",\"dataSourceId\":\"DATASOURCE\",\"maxLength\":-1,\"minLength\":-1,\"periodIndex\":0,\"aggregated\":false},{\"type\":\"STRING\",\"dataSourceId\":\"DATASOURCE\",\"maxLength\":-1,\"minLength\":-1,\"periodIndex\":0,\"aggregated\":false},{\"type\":\"STRING\",\"dataSourceId\":\"DATASOURCE\",\"maxLength\":-1,\"minLength\":-1,\"periodIndex\":0,\"aggregated\":false},{\"type\":\"STRING\",\"dataSourceId\":\"DATASOURCE\",\"maxLength\":-1,\"minLength\":-1,\"periodIndex\":0,\"aggregated\":false},{\"type\":\"STRING\",\"dataSourceId\":\"DATASOURCE\",\"maxLength\":-1,\"minLength\":-1,\"periodIndex\":0,\"aggregated\":false}],\"rows\":[[\"surname\",\"givenname\",\"allLowerEmail\",\"title\",\"Supervisor Full\",\"Federation ID\"]],\"numRows\":1,\"numColumns\":6,\"fromcache\":true}",
Views
Replies
Total Likes
Ok, so it looks like you're array is contained in data[columns], is that correct? If so, that's what you need to map into your iterator, get({{data}};columns).
Views
Replies
Total Likes
This is what I have based off of what you said, but this returns an empty array. (Rows contains the values I need). Am I doing something wrong?
Views
Replies
Total Likes
Is the data being encoded as a string? If so, you may need to parse as an object first before you attempt to get the "column" member. Something about the way your sample data was posted is just triggering my spidey sense....
Views
Replies
Total Likes
Don't put the squirrely brackets in, sorry. They're already embedded if you click the collection. Also, I told you the wrong field. It should be the output of the JSON parser that you are loading {{21. Data}} into, not the raw string, sorry about that. If you can just pick the rows collection coming out of the JSON parser, then you can just do that, you don't need the whole get statement.
Views
Replies
Total Likes
So I've spent the whole day putzing with this scenario. I can't figure out what the issue quite is. I tried parsing the data object using HTTP module and the JSON modules. Neither have gotten me very far - as for Chris' advice, the get function returns an empty array. I was able to iterate off the parse module and got this result which contains all the column values from the data object, but it doesn't appear I have the ability to reference any of these rows in another module (I tried to iterate off of the "Value" response from this result to no avail).
Views
Replies
Total Likes