# Grouping text categorization choices in custom recipe

**URL:** <https://support.prodi.gy/t/grouping-text-categorization-choices-in-custom-recipe/3070>\
**Category:** Uncategorized\
**Tags:** enhancement, textcat, front-end\
**Created:** [June 24, 2020, 12:08pm UTC](https://support.prodi.gy/t/grouping-text-categorization-choices-in-custom-recipe/3070 "2020-06-24T12:08:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniyalSelani](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/daniyalselani/32/1140_2.png) [@daniyalSelani](https://support.prodi.gy/u/daniyalSelani)\
**Post date:** [June 24, 2020, 12:08pm UTC](https://support.prodi.gy/t/grouping-text-categorization-choices-in-custom-recipe/3070/1 "2020-06-24T12:08:18Z")

</div>

I want to use a custom recipe to categorize texts, however, i want to group my choices in the UI under different titles. For example:

1. Single/multiple:
2. class\_1 = single,
3. class\_2 = multiple,
4. class\_3 = none
5. Shape:
6. class\_4 = round
7. class\_5 = oval
8. class\_6 = etc
9. Margin:
10. class\_XX = …

I couldnt find anything related to this in the prodigy read me, and i was hoping that you could help.  
Thank you!

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [June 25, 2020, 9:14am UTC](https://support.prodi.gy/t/grouping-text-categorization-choices-in-custom-recipe/3070/2 "2020-06-25T09:14:09Z")

</div>

Hi! There are different ways you could do this at the moment: one would be to use [multiple `blocks`](https://prodi.gy/docs/custom-interfaces#blocks) with a `choice` UI, and add the different `"options"` to each block. You could also combine all options into one and use custom CSS or the label names to indicate the grouping.

The only downside is that in all cases, the options would write to the same underlying `"accept"` key, so you need to allow multiple selection, and you couldn't easily indicate relationships within the grouping (like, only allow one shape and one margin value). I've been thinking about maybe letting th `choice` UI customise the key it writes to (just like the `field_id` setting in the `text_input` interface), so you could have different choice blocks that are either multiple or single choice and store their selection in different properties.

If you want full flexibility, another option would be to use custom [HTML and JavaScript](https://prodi.gy/docs/custom-interfaces#js-css) and just build your own form with multiple checkboxes / radio button groups. Calling `window.prodigy.update` lets you update the current task with any custom data, like information about the checkbox that was selected. Here's a straightforward example of a custom checkbox:

> [@Asking multiple questions in one task (different input types)](https://support.prodi.gy/t/asking-multiple-questions-in-one-task-different-input-types/2990/10):
>
> Thanks a lot! I ended up with an inline function in the html form fields, since when invoking a function that I defined in the JAVASCRIPT variable, I got errors stating that the function was not defined (yet). Not sure why that is, but maybe because the JAVASCRIPT content is inserted into the webpage after all the HTML is rendered and processed? For anyone interested in this solution, a minimalistical HTML in my recipe looks like this: \<input key="{{\_task\_hash}}" type="checkbox" id="checkbox\_i…

---

<div class="post-metadata">

**Author:** ![daniyalSelani](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/daniyalselani/32/1140_2.png) [@daniyalSelani](https://support.prodi.gy/u/daniyalSelani)\
**Post date:** [June 26, 2020, 9:21am UTC](https://support.prodi.gy/t/grouping-text-categorization-choices-in-custom-recipe/3070/3 "2020-06-26T09:21:04Z")

</div>

Thank you so much!
