Error "Argument could not be type checked" when using a String List data type property as a data function input parameter.

Error "Argument could not be type checked" when using a String List data type property as a data function input parameter.

book

Article ID: KB0079788

calendar_today

Updated On:

Products Versions
Spotfire Analyst All Versions

Description

When using 'List Box (multiple select)' property controls, the property data type is automatically set to a 'String List'. If the input handler for the string list input parameter is set to 'document property', 'data table property' or 'column property' (depending on your property type) then you will receive the following error when executing the data function:
Could not execute function call.
Could not calculate inputs.
Argument 'myStringListPropertyInput' could not be type checked.

Cause:
String list property data types are not supported for data function input parameters.

Issue/Introduction

Error, "Argument could not be type checked" when using a String List data type property as a data function input parameter.

Resolution

When defining the data function input parameters for your input parameter that will use the property of data type string list, follow these steps in the 'Edit Parameters' Input tab:
  1. Select your input parameter that will use the property of data type string list.
  2. Choose the 'Expression' input handler instead of the 'Document property', 'Data table property', or 'Column property' options.
  3. Click the 'Edit' button.
  4. Enter an expression such as (with quotes, and updated for your property name):
    • "${myStringListProperty}"
      or
    • $map("'${myStringListProperty}'", ",")

This will cause it to return a string of the values from the List Box property control separated by commas.
 

For example, your selection in the List Box are 3 values: A,B and C. Using the Expression "${myStringListProperty}", this passes “A,B,C” to the statistical engine. Using the Expression $map("'${myStringListProperty}'", ","), this passes “'A','B','C'” to the statistical engine. Within your data function you can then parse or handle this data as desired. For example, you can split these values into separate values using unlist() with strsplit() or many other methods. 

 

Example:

> unlist(strsplit("A,B,C","\\,"))
[1] "A" "B" "C"

Additional Information

Doc: How to Use Data Functions