Handlebars Template Doesn't Have Relation Data

I can’t access nested user objects when I use handlebars

In my user object I have the relation to its campaign:

{
  username: 'test'
  campaign_id: 8,
  campaign: {
    name: 'test'
  }
}

If I use string template engine, I can access {{$user.campaign.name}} object. However I I switch to handlebars engine, this object is gone.

I tried to log the object usin {{log $user}} and I saw only

{
  username: 'test'
  campaign_id: 8,
}

Environment

  • NocoBase version: 1.6.33
  • Database type and version: PostgreSQL
  • OS: Railway,
  • Deployment Methods: Docker
  • Docker image version: nocobase/nocobase:latest

How To Reproduce

  1. Create relation field to user
  2. Create markdown block with handlebar engine
  3. add {{log $user}}

Expected behavior

If I use string engine, I see nested objects, I expect the same behaviour using handlebar.

I’ve read the documentatino https://docs.nocobase.com/handbook/ui/blocks/other-blocks/markdown

where it says:

Currently, Handlebars does not support preloading association data. Users need to explicitly configure the corresponding association fields in the data block to retrieve the relevant data during rendering.

But it still unclear how am I suppose to explicitly configure current user object

Regarding the issue with Handlebars not automatically loading relational data: for example, in the screenshot, you first need to configure the ‘Shipment’ association field in the Order table block. Only after that, when you open the detail popup, can you use Handlebars to access the Shipment’s subfields tracking_number.

And how about user relations? It seems that there is no way I can load them, am I right?