Referencing data in templates
In addition to the variables available as part of the workflow run scope, you can also reference data from the users, objects, and tenants that exist within your Knock environment.
Referencing data is a powerful way to share context across entities in your templates without needing to manually pass the data in the data
argument of your workflow trigger.
user
filter
Referencing users via the To reference a user, you can use the user
filter. This will return a serialized User
, which you can then use to output data in your template.
Users returned will have all custom properties available, as well as the id
, name
, email
, phone_number
, created_at
, and updated_at
properties.
object
filter
Referencing objects via the To reference an object, you can use the object
filter. This will return a serialized Object
, which you can then use to output data in your template. When referencing an object, you'll also need to specify the collection
of the object you're loading.
Objects returned will have all custom properties available, as well as the id
, collection
, created_at
, and updated_at
properties. Read more about working with objects.
tenant
filter
Referencing tenants via the To reference a tenant, you can use the tenant
filter. This will return a serialized Tenant
, which you can then use to output data in your template.
Tenants returned will have all custom properties available, as well as the id
, created_at
, and updated_at
properties. Read more about working with tenants.