How to use Input Field[Multiple Lines] property control to pass multiple values as an input to On Demand table in TIBCO Spotfire

How to use Input Field[Multiple Lines] property control to pass multiple values as an input to On Demand table in TIBCO Spotfire

book

Article ID: KB0071483

calendar_today

Updated On:

Products Versions
Spotfire Analyst All

Description

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.

Issue/Introduction

Using Data On Demand on table with Property control option and getting input using Input Field[Single Input] property control. This works fine and data is pulled into the on demand table correctly. But when using the same table as an on demand with Input Field[Multiple Lines] property control , all the values provided in property control are not considered and no output is retrieved.

Resolution

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. 
  1. Create a list property "listbox" by adding a 'List box (multiple select)' and then add a new property to the control. You can now delete the added List box if you do not want to show this in your analysis.
  2. Select the new list property created "listbox" as the On Demand input parameter. The list properties cannot be set from the property editor. It needs to be set from a script.
  3. Define an input that can be used to parse value into the list.
Create an Input Field[Multiple Lines] property control "Inputmulline". Adding a script on this property changes that parse the value to the list property.
Parse script (change the separator as required):
import re
string = Document.Properties['Inputmulline']
list = [x.strip() for x in string.split('\n')]
Document.Properties['listbox'] = list

Note : change the property names accordingly.

4). When you enter Multiple inputs in the property control "Inputmulline" , on demand will work and fetch results.

Detailed documentation is attached to this document in the file "UseInputFieIdDataOnDemand.pdf".

Attachments

How to use Input Field[Multiple Lines] property control to pass multiple values as an input to On Demand table in TIBCO Spotfire get_app