I have a site that has lots of checkboxes. They are in different accordions but are all part of the same form. Labeling these will be a huge effort and setting custom attributes will be even more difficult.
I have all the labels in a Google sheet under the appropriate headers.
My question is can I import the sheet or refer to it, using the applicable header and cell values for the labels and the custom attribute? The custom attribute will have a “data-ms-item” prepended to the label.
Any suggestions would be greatly appreciated. I don’t want to manually set up 100+ checkboxes.
hi @hogana AFAIK in WF is not such a mechanism that will dynamically create attributes and permanently assign their values into FW UI elements attribute fields from Google Sheets or any other sort of source. This should be done when creating a form.
In code world this can be done with javascript, but again this will be a dynamic process where all data (attributes and values) will be created on page load and it will be more difficult as you have different values for each input (checkbox).
Just like Stan, I’d use JS for this kind of requirement-
However I think there’s actually a way to do it without any JS if you use collection lists.
You can import it into a CMS collection, and then use collection lists inside of your form to generate and present the checkboxes.
Prepare your checkbox list so that you have a checkbox name, group, and possibly a sort field. Import that CSV into the CMS, as e.g. the Checkboxes collection
Drop collection lists into each of your accordions, bind each to your Checkboxes collection. Use conditional filtering and sorting on each collection list to get the set of collection items you want, and then lay them out accordingly.
You can temporarily use a checkbox element for the above but you will not be able to bind your desired checkbox name for output, so in the final version you’d drop an HTML Embed with an actual checkbox into that collection item, and bind it- something like;
Using CMS hack is actually a great idea but IMHO it is more work and unnecessarily complicated hack than doing it manually, but in the end, it will depend on the dev skills level.