I have a formula (screenshot). I get an error saying “First parameter must be an array (or collection)”. But if I check my backups, from 5 days ago (second screenshot), I have the same formula and it is working just fine. No errors, it shows elements correctly etc… Why do I get the issue, so I can try to solve it?
@tcc hi!
As far as I can see, in the first screenshot, you have the variable "item.data[0], which is not an array, but the first element of an array. That’s why you got an error.
On the second screenshot you have a variable “item.data” which could be an array.
Great catch! Thank you. I changed the “item.data”, however I still don’t get any data out. The collections were not changed and are (down)loaded, so I don’t know if it is a bug or something else.
The formula is on the Stack Weweb element. On Friday I lost half of my stack element (I have a stack inside a stack), so I had to search in my backup to find the element back. If when I paste the backup element inside the Live version, I don’t get the results, however in the backup I still have them (even after changing the item.data).
I have the feeling Weweb was updating the element, that is why I lost half of the element and it is probably still not working well…
I still notice some differences between the formulas on your screenshots, so it’s hard to tell what’s the reason without examining the data.
A video demonstration might help investigate the problem.
Ok, I understand what is wrong. If the result of a formula is empty, as there is no data for this filter, it doesn’t show the rest of the results from the formula. I have some formulas that give an empty result as there is no data for this filter (yet). Before it was working, that if there was no result for one part of the formula, it still showed the results within the formula that corresponded to one part of the filter. Any idea how to solve this easily?
Still, I don’t know your data structure, so I can’t come up with the best solution. However, what I would personally do is get rid of complex formulas (if possible). They’re hard to maintain.
I would use variable-bound logic with branching through workflows. But it’s just a guess.