Skip to main content

Template variables

automatic pre-fill rules

It's based on field IDs:

 {
"enitities": [
{
"id": "entities",
"name": "Entities",
"required": true,
"minValues": 1
}
],
"components": [
{
"name": "List item",
"fields": [
{
"id": "name",
"name": "Title",
"validTypes": ["string", "number", "date", "dateTime"],
"required": false,
"multipleFields": false
},
{
"id": "thumbnail",
"name": "Avatar",
"validTypes": ["string"],
"required": false,
"multipleFields": false
},
{
"id": "other",
"name": "Other",
"validTypes": ["string", "number", "date", "dateTime"],
"required": true,
"multipleFields": true
}
],
"props": []
}
],
"generatePagePreviewUrl": "https://deploy-preview-1362--iteria-lowcode-monorepo.netlify.app/test/orders"
}

  • thumbnail: looks for signed urls GetUrlReturn type and optionally with more priority via this regex /signed.*Thumbnail.*$/i or alternatively these regexes /signed.*Thumbnail.*$/i, /signed.*LogoPath$/i, /logo_path$/i, /signed.*ImgPath$/i, /url$/i
  • name: looks for strings via these regexes /.*name/i, /.*title/i
  • geoJson: looks for fields with geography type
  • start: looks for date fields and optionally with higher priority some which name also includes 'start'
  • end: looks for date fields and optionally with higher priority some which name also includes 'end'
  • x-axis/y-axis: looks for fields of those types 'numeric', 'Int', 'bigint', 'numeric', 'date', 'time', 'timetz', 'timestamp', 'timestamptz'
  • description: looks for strings, excluding those that match regexes /id$/, /.*Id$/, /.*Path$/, /updated_at$/i, /updatedAt$/i, /created_at$/i, /createdAt$/i, /is_deleted$/i, /isDeleted$/i, /signed.*Thumbnail.*$/i, /signed.*LogoPath$/i, /logo_path$/i, /signed.*ImgPath$/i, /url$/i
  • other: looks for all SCALAR type fields, excluding those that match regexes /id$/, /.*Id$/, /.*Path$/, /updated_at$/i, /updatedAt$/i, /created_at$/i, /createdAt$/i, /is_deleted$/i, /isDeleted$/i, /signed.*Thumbnail.*$/i, /signed.*LogoPath$/i, /logo_path$/i, /signed.*ImgPath$/i, /url$/i
  • generatePagePreviewUrl: the url for template preview page

Logic is in this file: packages/wysiwyg/src/lib/utils/templateVariables.ts