In textfields we have the option to create a checkbox list,
Can we control (check/uncheck) the checkboxxes also through a formula?
Of course I can create a couple of seperate checkboxxes, but by using this option, this will give me a much more compact view of tasks which have to be done before (in my case) an invoice is ready to be send.
I did some more research, I wonder if i’m on the right way if I try to solve this problem by altering the raw data, and add the ‘isChecked’ with a formula. Afterwards I have to render the JSON again back to the list of checkboxxes of course, which seems to be a challenge aswell.
@Daniel_Stieber Thanks for you help, I had some trouble as it seems Coda changed some things in the way the JSON code of the TextField-Checkboxxes work. For example, in the current JSON code there is no ’ isChecked: False’ (see also the GiIF in the post of yesterday) so the RegexReplace does not work if the checkbox is initially unchecked.
Also the Split/Join option as @Paul_Danyliuk mentioned seems not to work anymore, when splitting a checkbox list, the checkbox is not removed. And also joining with an empty checkbox seems not to be adding one (at least not in the demo in my enviroment).
Another issue for me is the fact I don’t want a list to be checked or cleared completely, I want to check a certain box (when a step is finished in another table).
So now I created a column (isChecked) with a new object:
where Status is a good-old formula-controlable checkbox.
Which I’m merging (and parsing) with the orginal Textbox into a new Column:
Finally I can concatenate the different TaskStatuses into a new column.
I takes quite some helper columns (I guess some can be eliminated?)
As I’m quite new into the coda community, I guess my solution is probably not best-practice (and relying on experimental functions), but for now it wil do the job.
That something that I found surprising as well. It had been my assumption that the formula: thisrow.Ingredients._Merge().ToText())
would result in the JSON, which for each item within that list would indicate either “isChecked”:True or “isChecked”:False.
As you state, though, @Ronald_van_Meurs , I also found that this parameter is not present for unchecked checkbox items, but solely is added when the checkbox is ticked-off (hence, when it is changed to “isChecked”:True.
That rendered my intent to formulaically control the checkboxes via a formula thisRow.Raw Json.regexreplace('"isChecked":true','"isChecked":false' )
I dabbled around some more trying to Concatenate the parameter isChecked to each item within that list, but it soon became obvious that this not a sustainable method.
So, I too think that Buttons are the way to go, instead of diving ever deeper into ParseJson