Description
The SetFlavor
function is used to programmatically set the value of a custom field (Flavor) within a project or task. It is often used in workflows to dynamically update custom data fields.
SetFlavor
is particularly helpful when values generated or calculated in a workflow should be automatically written to a Flavor.
Syntax
SetFlavor(fieldName, fieldValue)
Arguments
Argument | Description |
---|---|
fieldName |
The name of the custom field (Flavor) to be set. |
fieldValue |
The value to be written into the specified custom field. This can be a static or dynamically calculated value. |
Return Types
The function does not provide a direct return value. It is used to store a value in a custom field (Flavor).
Examples
Description | Formula |
---|---|
Simple setting of a Flavor value |
Process( SetFlavor("ProjectStatus", "In Progress") ) Sets the value of the |
Dynamic value based on a calculation |
Process( SetFlavor("CostOverview", sumAll("Costs", true)) ) Writes the sum of all costs into the |
Usage within a button |
createButton( 1, "Update Project Status", "Sets the project status to 'Completed'", "Process( SetFlavor('ProjectStatus', 'Completed') )", "", "", "", "The project status has been successfully updated.", "", "check-circle" ) A button that sets the |
Notes
- Accuracy of field names: The Flavor name must exactly match the name defined in Smenso.
- Consider data types: The value should match the data type of the Flavor (e.g. text, number, date).
- Combining with other functions:
SetFlavor
can be combined with other functions likeif
,sumAll
, orformat
to create dynamic values. - Using the
Process()
function: To avoid errors such as"Can not execute async functions outside async context"
,SetFlavor
must be used inside aProcess()
function.
Comments
0 comments
Please sign in to leave a comment.