Canvas Dashboard Visualizations Generating Incorrect Field Reference in Code

Hello!

I am getting errors for incorrect field references in the code when I attempt to generate a visualization in a Canvas Dashboard. The field references are currently being generated as:

ref: r(sales_model.sum_transactions)

I also get the error Property ‘sum_transactions’ does not exist on type ‘Model’.

The field references were previously being generated as:

ref: ref('sales_model' , 'sum_transactions')

If I edit the code to match the previous field reference pattern, the visualization does display as anticipated.

2 Likes

Hi @hannah.paxton,

Thanks for reporting the bug!

Just a heads-up: the r function is a new version of ref that supports live validation. However, we’ve identified a bug where r doesn’t work correctly with extended models—which seems to be the case for you.

We’re really sorry for the inconvenience this has caused. We’re working on a patch and will let you know as soon as it’s released.

In the meantime, your workaround of reverting to the old ref function is the right approach—please feel free to continue using that for now.

Hi @hannah.paxton,

FYI, we have rolled back to use the old ref syntax for code generation until the r function is fully polished!

Best regards,