New agent legacy - smartfield


We’ve migrate to the new legacy agent & we’ve a question regarding smartfields.
Is there a shorter way to create smartfields from a relationship without creating each one on index.js.

We’ve the following relationship between “users” & “beneficiaries” tables/models :

        user.hasOne(beneficiary, {
            foreignKey: "fk_userId",

The “fk_userId” appears on Visual builder > Fields.
We’ve drag & dropped the “fk_userId” field in the smartview & the id links us to the correct user (table users).
Is it possible to access user’s data through fk_userId without declaring each fileds, getValues… on the index.js please ?


  • Project name: Nostrum Care v3
  • Team name: Op
  • Environment name: development
  • Agent (forest package) name & version:
    @forestadmin/agent”: “^1.0.0”,
    @forestadmin/datasource-sequelize”: “^1.5.21”,
    @forestadmin/datasource-sql”: “^1.0.0”,
    “dotenv”: “^16.0.1”,
    “pg”: “^8.8.0”,
    “sequelize”: “^6.33.0”
  • Database type: Postgresql
  • Recent changes made on your end if any: …

Or is there a way to create multiple smartfields from one getValues on the user please ?

Hello @nadiab :wave:

I’m having a bit of trouble understanding your need :thinking:, could you elaborate a bit more? Maybe an example or a screenshot would help. :pray: :slight_smile:

Kind regards,