Closed NexPlex closed 1 month ago
Hello @NexPlex, you should use the Generated String Value Model. Here is a nice example: https://github.com/nocode-js/nocode-platform-boilerplate/blob/main/src/lib/workflows/endpoint/model/steps/flow/forStepModel.ts
step
.name()
.dependentProperty('from')
.dependentProperty('to')
.dependentProperty('delta')
.value(
createGeneratedStringValueModel({
generator(context) {
const from = context.formatPropertyValue('from', StepNameFormatter.formatDynamic);
const to = context.formatPropertyValue('to', StepNameFormatter.formatDynamic);
const delta = context.formatPropertyValue('delta', StepNameFormatter.formatDynamic);
return `${from} < ${to}, Δ${delta}`;
}
})
);
How can I dynamically update the task name to include one of the property values? Here is my model. I'm trying to have the name = 'Say or Ask ' + property('question') value.
export const questionTaskModel = createStepModel('question', 'task', step => {
step.category('Questions');
step.name().value(createGeneratedStringValueModel({
generator(context) {
return 'Say or Ask' ;
}
}));
step.property('question').value(
createChoiceValueModel({
choices: ['Text'],
defaultValue: ''
})
).label('Script');
step.property('question_id')
.value(createStringValueModel({
});