Reputation: 43
I am hoping to replicate the copy paste function in Contour to a Workshop application that I am building.
As you know, when you copy a list of items (e.g. from Excel) into a Contour's filter, it will automatically break them down to separate items (screenshot). I can't seem to do this in a Workshop application's filter.
The only way that I can think of is use a function backed text area but haven't managed to do that.
Upvotes: 0
Views: 39
Reputation: 1359
Indeed, using a Function is the right move here. You will essentially parse the string and perform the operation(s) you need on it.
Example of function (untested, but should give you a high level pointer):
@Function()
function parseExcelString(excelString: string) : string[] {
// Split the string by newlines and tabs to separate all items
const items = excelString.trim().split(/[\n\t]/);
return items;
}
Steps at high level:
And in workshop:
text input
widgetparsed_strings_array
) that is a "function execution" and that outputs a string array
You now have a variable with an array of the different values populated from what was copy-pasted by the user !
You can now use this string array variable
to filter your Object set variable
by selecting Filter ... On a property ... (x)
Upvotes: 1