I have a page of results which is filtered by a sidebar filter. Because I’m working with an external API pulled into Xano, each user will use tag filters, but they are displayed in different groups. The groups are collections.
In the screenshot above, Style, Frequency, and Type are each items in a collection. In each item, there is a multiselect in which they can choose filters. Each selection in the multiselect corresponds to an integer.
I am passing the results of these filters into a variable, using this method.
My goal is to get a list of the values combined: [2, 5, 13, 8]. I can do parsing in Xano, but is there any way to get closer to my goal in WeWeb before doing that Xano parsing? The number of objects will vary by user.
What I would do, is rather save the items from each select in an array, you can do this with Change Variable Value → Insert at an index and use your item.context.index
then it’s as simple, as doing a rollup nocode formula
I mean, you’re storing the items as “numbered” object’s properties (which are objects), so you might as well use an array, which basically is the same thing, but with some perks, like rollup formula.
Thank you, @Broberto. This is still a few steps beyond my knowledge at this point.
I can get at context.item.index. I see the “Insert at an Index” when I am using a an “array” variable. But I think I’m missing some granular steps here. Where are the values being collected before being rolled up?
I tried just adding all selected items to the end of an array, but then the deselect in the multiselect doesn’t work.
let newArr = []
// replace variables[...] with your array variable where you store the items from selects
variables[/* arr */'155b806a-1da6-40ab-bf17-23050456fafc'].map((item)=> {newArr=[...newArr, ...item]})
return newArr
With update one item, you also get to edit em, not just add them.