Changing property value through validation?
Posted: Thu Sep 26, 2024 5:23 pm
I notice that some apps validate it's properties when designing and when I use "Multi-line text" they usually join the array I input with ";".
How can I do that in my script?
I was looking at the flowElement methods, and there is no setPropertyStringValue or something like that.
Here's my current code:
Using a logic that does that makes it easier for the rest of the code as I'll always get a string with ";" to separate the values.
How can I do that in my script?
I was looking at the flowElement methods, and there is no setPropertyStringValue or something like that.
Here's my current code:
Code: Select all
async function validateProperties(s: Switch, flowElement: FlowElement, tags: string[]): Promise<{ tag: string, valid: boolean }[]> {
let resultArray: { tag: string, valid: boolean }[] = [];
let tag: string;
for (let i: number = 0; i < tags.length; i++) {
tag = tags[i];
const value = await flowElement.getPropertyStringValue(tag);
if (/stringList\d+/.test(tag)) {
await flowElement.getPropertyStringValue().
await flowElement.log(LogLevel.Debug, typeof value == "object" ? value.join(";") : value);
resultArray.push({ tag: tag, valid: true });
}
}
return resultArray;
}