Appending text to a cell's current value

hello,

I’m trying to modify a row to add the current value of a selector, how do I append onto what is currently in the cell only ?

With the example below i can’t access just the single row in question - it will append to the entire columns worth of data (try the button a few times with different rows ticked to see the unwanted behaviour …)

thanks

Hi @Josh_Bullock,
welcome to Coda Community! :handshake:

I started to have a look at your doc but unfortunately I have to stop for a while: I’m getting back to it as soon I can (sorry for this).
Meanwhile, I hope you can see the concept behind: you should put in the column what that column contains (in this case, a list of shelf items).

hmm sorry I don’t follow your thinking, but thanks for helping !

don’t worry, I’ll wait :slightly_smiling_face:

Let me know if the above document is what you were looking to accomplish.

1 Like

Hi @Josh_Bullock,
I did some changes and it should now work as expected: because you need to have a reference on the “current” row, I added an explicit button that actually run the action.

However, I’d suggest to think of a simple data design with one row per item (for instance, as indicated by @Joshua_Upton) and then aggregate the rows to have the all basket.

I hope this helps.
Cheers

1 Like

hi @Federico_Stefanato , yes perfect ! That works just how I wanted it to. :slightly_smiling_face:

now how would I do the opposite - as in remove the item from the basket, that is on the shelf selector …

Thanks also @Joshua_Upton . However I was just using the basket idea as an analogy - I needed to edit just a single cell in a column as per @Federico_Stefanato 's changes

Hi @Josh_Bullock,

And here we go: with the same logic, I added a new button doing the removal (thisRow.Basket.Splice(thisRow.Basket.Find(Item),1)).

:wink:

1 Like

perfect thank you ! took me a while to understand because the coda formula didn’t show the “thisRow” element, but here is the formula pasted below - for other who stumble on this thread.

shelf.Filter(CurrentValue.Contains(thisRow.Basket) || CurrentValue.Contains(Item))