:merged-with modifier for single items too, not for lists only

now I can merge a list with an item (I assume with another list too) via merged-with. Guess that is doing PUT (place at end of first list)

when I want to merge an item with an existing list at the start of it (LPUT), I need a :merged-with for that item

anyway, the greater need for the :merged-with to be available for items is to be able to make lists on the fly
e.g. at the issue mentioned at Edit more complex expressions I’d just make a list out of my 4 items and then get the average value instead of making a very complex expression where I divide each by 4 (not very flexible to hard code such values btw, average is better) and then add them (since I don’t have parentheses in expressions)

this in fact can help with the issue of parentheses not being available, since one could make a list and then get the sum of its items etc.

e.g. (x+y+z)f would be
f
x:merged-with y:merged-with z, assuming :merged-with has higher priority than * (not sure if it does)
if it has lower priority it would be x:merged-with y:merged-with z*f instead.

priority btw could be shown by showing a bit more space arround those operators with less priority in the editor, e.g. :merged could have less spacing from x than * if :merged-with has higher priority. Usually two or three priority classes are enough for operators

I think that’s what you need https://bubble.io/reference#Data.Messages.list.plus_element

1 Like

this url bookmark doesn’t seem to work, goes to page top

if you mean the operation that adds to a list, it isn’t useful in my case since I don’t have any list, I just have four dynamic elements and I want to make a list out of them in an expression to then call :average on it

also when one wants to prepend an item to a list, they need an operation that has the item first and then some operator that accepts a list as parameter. That could be item + list I guess if you alread support list + item. Although + could be misunderstood there when you work with numbers

would be nice if I could at least (as a workaround) use a hidden group to add all the elements there and then tell it to give me say the titles of all Text elements in it (which titles I’d have dynamic from my db), but can’t either