How to check if all checkboxes in a canvas are checked?

Hi there, I want to disable a button in a table until all checkboxes in a canvas (in the same row) are checked. Is this possible? The checkboxes are content in the canvas, not in a table.

Cheers,
Freerk

1 Like

hi @Freerk_Lap ,
I remember that @Paul_Danyliuk has solved this before, but I could not find it directly so below how I would handle it (but I guess that Paul had a different way).

  • First we turn the canvas column into a JSON object
  • second we count the checkboxes
  • third we note how many of these are checked
  • the last step is comparing step 2 & 3

the rest is obvious
cheers, Christiaan

4 Likes

@Christiaan_Huizer, bravo!

You are a god-send Christiaan! Your articles on Medium keep popping up too. Its an honor to have you solve my riddle :smiley:

Thanks for the compliments @Freerk_Lap
This is the article I wrote about your question:

enjoy, Christiaan

1 Like

@Christiaan_Huizer I made a slight adaptation in your script to account for other content in the canvas. Using …style pulls in all elements, so I first convert the parseJSON into a list, then filter that list for items that contain CheckboxList.

listcombine(thisRow.[Definition of Ready]._Merge().ToText().ParseJSON("$..style")).Filter(Contains(CurrentValue, "CheckboxList")).Count()

interesting and very well done. As often stated: in Coda is everything a list and once you see this, it cannot be unseen. I adapted my blog and document accordingly:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.