How can i add fields when i select relation field?

Product type:
–name
–price
–category

Category type:
–name
–size
–feature
–material

In strapi 4 I have a product and category content type if user select a category (relation field). Category content type have text and json field (array of strings). then user can select multiple values (like multi-select) from given json field category content type. Example some products have only large and medium sizes. And some have all size user can select from it. While in content editor .Can I do that?

This topic has been created from a Discord post (1239273444340666429) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

Oooo, fun question. So Strapi doesn’t populate fields/relations when certain field values are selected.

However, you could customize/extend the admin panel to make it do what you need – maybe in combination with a custom plugin. Admin panel customization | Strapi Documentation and Developing plugins | Strapi Documentation

After looking into it some more it does look like there’s an open ticket for this kind of functionality: Parent & child relationship/field | Content Editing XP | Strapi

It also looks like dimatkach11 (DIMA here in this discord) has made a custom plugin for this exact functionality here: GitHub - dimatkach11/strapi_plugins

There is actually GitHub - antokhio/strapi-plugin-categorizer plugin

thanks brother