Product: TIBCO Spotfire®
How to use Input Field[Multiple Lines] property control to pass multiple values as an input to On Demand table
When using Data On Demand on table with Property control option and getting input using the Input Field[Single Input] property control, it works fine and data is pulled into on the demand table correctly. But when using the same table as an on demand with Input Field[Multiple Lines] property control, all values provided in the property control are not considered and no output is retrieved.
Steps to create the scenario-
1).Create a Input Field[Multiple Lines] Property control to get the inputs.
2).Use Data on Demand on data table and define input and use the document property created in step 1.
3).Enter some values in Property Control. Resultant data for the multiple inputs is not extracted but it works with single value Input Field or if single value is input in Input Field[Multiple Lines] property control. Follow the steps below to use the Input Field[Multiple Lines] property control as an input for Data On Demand table to pass multiple values.Use the list variant of the Document Properties.
Create a list property "listbox" by adding a 'List box (multiple select)' . ( You can now delete the added List box if you dont want to show this in your analysis)
Now select the new list property created "listbox" as the On Demand input parameter. You will find that list properties cannot be set from the property editor. It needs to be set from a script.
We need to define an input that we can use to parse value into the list. Now Create a Input Field[Multiple Lines] property control "Inputmulline".
Add a script on this property changes that parse the value to the list property. Parse script (change the separator as required):
string = Document.Properties['Inputmulline']
list = [x.strip() for x in string.split('\n')]
Document.Properties['listbox'] = list
Note : change the property names accordingly.
Now when you enter Multiple inputs in property control "Inputmulline" , on demand will work fine and fetch results.