# Database structure plugin question

**URL:** <https://community.novulo.com/t/database-structure-plugin-question/741>\
**Category:** \[Q&A\] General\
**Created:** [June 9, 2025, 12:08pm UTC](https://community.novulo.com/t/database-structure-plugin-question/741 "2025-06-09T12:08:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joeri](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.novulo.com/joeri/32/428_2.png) [@Joeri](https://community.novulo.com/u/Joeri)\
**Post date:** [June 9, 2025, 12:08pm UTC](https://community.novulo.com/t/database-structure-plugin-question/741/1 "2025-06-09T12:08:44Z")

</div>

I’m trying the following:

 ![image](https://canada1.discourse-cdn.com/flex008/uploads/novulo/original/2X/7/730fca396f4e822c999b974356869af851c27272.png)

For each field I check if it a recordtype or a simple field:

 ![image](https://canada1.discourse-cdn.com/flex008/uploads/novulo/original/2X/b/b8288c42710b811cb4529ddf9a422909036c69c6.png)

If the field is a recordtype, I want to add a certain record called SearchField (a new entity i created in this component). I then set the following:

 ![image](https://canada1.discourse-cdn.com/flex008/uploads/novulo/original/2X/5/503340711954dbeb87fbd04ee684bb3d31225929.png)

What I’m trying to achieve here is: if say a field is contact.primary\_address (which is a recordtype), I then want to create a searchfield record and set the datatype (which is the plugin field DS\_DataTypeSelector) to addresses…

The process then get’s an error saying the following:

```auto
[Field data_type does not accept type novulodatastructuretypes]

```

Is it possible to find out what the db record type is and set it?

---

<div class="post-metadata">

**Author:** ![Helena](https://avatars.discourse-cdn.com/v4/letter/h/c68b51/32.png) [@Helena](https://community.novulo.com/u/Helena)\
**Post date:** [June 10, 2025, 7:22am UTC](https://community.novulo.com/t/database-structure-plugin-question/741/2 "2025-06-10T07:22:47Z")

</div>

What is the type of your data\_type field?  
I would think you could take a look at the Novulo Filter or Novulo Export components and see how it was set up there? They also have data\_type fields.

---

<div class="post-metadata">

**Author:** ![Joeri](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.novulo.com/joeri/32/428_2.png) [@Joeri](https://community.novulo.com/u/Joeri)\
**Post date:** [July 1, 2025, 9:49am UTC](https://community.novulo.com/t/database-structure-plugin-question/741/3 "2025-07-01T09:49:34Z")

</div>

I’ve managed to achieve this with the following method:

I first iterate over all fields of a certain datatype (which is a datatype selector field):

 ![image](https://canada1.discourse-cdn.com/flex008/uploads/novulo/original/2X/a/ae57ea94c7881724007587d076c25ef547ec8d16.png)

I then cache the field name:

 ![image](https://canada1.discourse-cdn.com/flex008/uploads/novulo/original/2X/c/ca83d0ae309ca29ac22f449dcf7ad8a721a44701.png)

I check if the field is not a foreign key (so is it a database type?):

![image](https://canada1.discourse-cdn.com/flex008/uploads/novulo/original/2X/3/3a99cf2cc70f6e12c61d0c710562dd2644b00530.png)

If it is a foreign key (so false), I check if it’s not a function:

![image](https://canada1.discourse-cdn.com/flex008/uploads/novulo/original/2X/1/1328f3574a089a3be6b93c43ae2c7ec2929fbf14.png)

If it’s not a function, so in this case its a recordtype, I set the datatype selector field with the following value:

 ![image](https://canada1.discourse-cdn.com/flex008/uploads/novulo/original/2X/c/cf39a9a46c47c3eecb3261720fe2ef4ce860cdc8.png)
