Get all model in custom field

System Information
  • Strapi Version: 3.2.4
  • Operating System: Mac
  • Database: Mysql
  • Node Version:
  • NPM Version:
  • Yarn Version:

Hello.

I create a custom field on my plugin.
Now I need to have the model data on the form which my custom field placed on it.
For example, I use this custom field in user content-type … I need to have access to all user record data in the custom field component.

How I can do this?

Can you be more explicit here please? Maybe with some screenshots with what you have now and what do you expect to achieve.

1 Like

Sorry I did not explain well.
Suppose I register a new custom field in the plugin And then I use this custom field in a content-type.
Now the problem is that in this custom field I need other values ​​of their content-type inputs.
For example, suppose I want to render something based on the value of the name field, which is another field in this content-type.

I hope you understand what I mean :thinking:

Got it, lets assume you have a field called OS which is enumeration type and it has next values: IOS, ANDROID

And you’ve created your own field type inside plugin, for example type: Phone Brand, which also acts like an Enumeration type and you want to render specific values when you select OS value. For example if you select IOS you want to render iPhone X, iPhone 11, iPhone 12 in your custom field

Did I get it right?

I think I know what you mean, it’s a parent/child relationship between fields in the same model.

So if you take the example of cars with two fields (Make/model)

If you select the make as “Ford” the models should only populate with models that are made by “Ford” like “Mustang” / “F150” / ect. Given I’m using a relational example here, but your point is dynamically adjusting the view based on other values. Given an enum and someone selects an “other” option a new text field should appear to fill out the information.

We don’t have an option for this yet, but it has been requested before.

Yes, exactly

We don’t currently have a solution for this but I would suggest you create a feature request on GitHub: Sign in to GitHub · GitHub

I would suggest calling it something like “Conditional Field views” or something along those lines :slight_smile:

i have a bit same thing to do
I have my custom plugin and i need depending on some Component field value (for example its Relation field) set some text value in my custom plugin.


Here is my Component
and EntryTitle is my Plugin. It have some options:

and i need select field inside Relation field. Options should be all fields inside Component. The main idea its i need to create field for Entry title for the Relation Field. (Some kind of fix Relation selection field is showing IDs instead of names)
How i can get list of fields inside my plugin, as i understand before registering app.customFields.register({ i need to get all fields and put it inside

        base: [
          {
            name: 'options.relation',
            type: "select",
            intlLabel: {
              id: 'form.attribute.item.dependency',
              defaultMessage: 'Relation field',
            },
            description: {
              id: 'form.attribute.item.dependency.description',
              defaultMessage:
                "Set field to build Entry Title",
            },
            options: [. ----- THERE```
But i cant find info where i can get fields.

Any update on this feature? We have similar need that a custom component need to know the value of certain fields of its parent.

My content type has a relation with categories, and these categories have relations with subcategories. I created a plugin to fetch the subcategories using the category ID, but I can’t retrieve the category ID inside my plugin.
Any updates?