Currently, I am getting a problem of referencing a specific element in a collection such as "1163:body.data" ("module-number.body:data") in Fusion. Therefore, I need to convert a collection to an array so that I can use array functions to get specific elements.
Does anyone know how to convert a collection to an array in Fusion?
I really appreciate it!
Anh Ly-Hang
Vanguard Group
Views
Replies
Total Likes
Can you include a screen shot of what your data looks like? I'm a little confused on what you are asking for, but I took my best guess below. If I'm wrong, data screen grabs could be useful to understand.
Collections and arrays are two different things. If you're just trying to pick something out of a collection, you don't need to use array tools, you can use the get command, which would look like get({yourCollection};{key}).
If you are saying you have an array of collections, and you need to drill down to the collection, you can use the iterator module on the array. If there's only 1 item in the array, you can use the get command also, get({yourArrayOfCollections};1).
Hi Chris,
Thanks very much for your shared expertise! It will remember how to use it.
For this reported issue, I was able to figure out how to get data that I needed from different module, instead of from the collection "1163.body.data" which I tried different approaches before, but I could not get data from it.
I really appreciated your input!
Anh Ly-Hang
Views
Replies
Total Likes
Hi Chris, I find this thread relevant so I am posting this question here. Please help.
I've used the iterator with target id and I've 9 bundles since that module and its good. But I am looking to create a variable for documentName and targetLanguage to be used in subsequent modules.
As you said, I've used
But I am getting only the first collection repeated as below in all bundles. Please help!
Views
Replies
Total Likes
Correct, you're essentially saying with your get statement, "Give me the first item in the Data Collection." If you are feeding Data into an iterator, then use the values coming out of the iterator, so for the document name, you'd map the documentName variable coming off of the iterator.
Views
Replies
Total Likes
Hi Chris,
I'm trying to make use of the wisdom you shared here, to solve my current challenge, but I fail to get results.
I use the "Read a record" module to pull data about an issue record and the data includes the value of a Portfolio typeahead custom field. The output of the bundle looks like this:
In the next "Set multiple variables" bundle I try to store the received ID in a variable:
But no joy - the ID is not "extracted" from the collection (is it a collection at all?):
I appreciate if you have the bandwidth to help with advise.
Thank you,
Tibor
Views
Replies
Total Likes
Tibor,
Are you still having issues with extracting the ID?
I created a similar typeahead field in our sandbox environment and was able to extract the ID by inserting a Parse JSON module and creating a data structure:
Data structure:
I took the variable values from the Parse JSON module:
This allowed me to extract both the portfolio name and ID:
Hi Kristen,
thanks for the response.
What you described is exactly my current solution and it does work, yes.
However, I find this a bit cumbersome. I have multiple typeahead fields on the form and I need a separate JSON parse module for each of them. I was hoping that maybe there is another way that allows me to extract the IDs using function(s) in the value fields of the Set Variables module.
Tibor
Views
Replies
Total Likes