Text evaluation

Type: Display

Description: Evaluates the cell value given the JavaScript expression.

This is an advanced rule which requires programming knowledge. It is more difficult to use, but much more powerful.

See the Advanced Scripting section for more detail.

Example: Check material name
  • Cell value: Stainless Steel 304

  • Rule value:

/* if the string is blank, return unknown */
if (!s & !rowData.isAssemblyRow) 
  return { message: 'unknown material' }
  • Result: Rule passes.

Example: Warn on empty or invalid rows for non-assemblies
  • Cell value: [blank]

  • Rule value:

/* if the string is blank and its a component, return warning */
if (!rowData.isAssemblyRow && !s) 
  return { message: `No material specified for this component`};

/* check for valid combinations */
if (s.toLower().includes('steel') && rowData.cells.partNumber.endsWith('RR'))
    return { message: `Invalid material specified for this component`};
  • Result:

    • Rule fails for non-assembly rows. Cell border is marked orange or red (depending on your pass / block setting)

    • Rule passes for assembly rows

Example: Empty revision must block
  • Cell value: [blank]

  • Property mapping setting: Is Readonly = checked

  • Rule value:

/* if the string is blank and its a component, return warning */
if (!s && pm.isReadOnly) 
  return { message: `The revision is blank. Please update at the source and reload the BOM`};
  • Result:

    • Rule fails and warning is shown, but only if the Property Mapping is marked as read-only.

For further details, reach out to us on our Support Ticket system.

Last updated