TDM Portal: seqlov function fails to escape commas when passed via variable
search cancel

TDM Portal: seqlov function fails to escape commas when passed via variable

book

Article ID: 437238

calendar_today

Updated On:

Products

CA Test Data Manager (Data Finder / Grid Tools)

Issue/Introduction

When using the seqlov function in the TDM Portal Generator, values containing commas (e.g., "Mon,day") are not correctly escaped if they are passed through a variable. The function may truncate the value at the first comma instead of returning the full string.

Example Scenario:

Variable ~Test~ Default Value: "Mon,day","Tuesday","Wednesday","Thursday"

Generator Expression: @seqlov(0,@list(~Test~)@)@

Actual Output: Mon

Expected Output: Mon,day

Note: Directly passing the values into the seqlov function (without using a variable) works as expected: @seqlov(0,@list("Mon,day","Tuesday","Wednesday","Thursday")@)@ outputs Mon,day.

Environment

Product: CA Test Data Manager (Data Finder / Grid Tools) Version: 4.11.x and earlier

Cause

Behavior varies between Datamaker and the TDM Portal when using double quotes to pass literal commas and spaces in arguments. While the TDM Portal always strips double quotes, Datamaker may not. For more information, refer to the 'Data Generation Functions and Parameters' section of the TDM documentation.

This issue occurs because the TDM Portal strips double quotes when calling the seqlov function. This causes the variable to be processed as a standard comma-delimited string, leaving the function with no way to escape the comma within 'Mon,day'.

Resolution

To resolve this, define the @list function within the variable itself and call the variable name directly in the seqlov generator.

  1. Modify the Variable Definition: Update the default value of the variable (e.g., ~Test~) to include the @list wrapper: @list("Mon,day","Tuesday","Wednesday","Thursday")@
  2. Update the Generator Expression: Use the variable directly in the seqlov function without an additional @list call:
    @seqlov(0,~Test~)@

This allows the seqlov function to recognize the variable as a pre-formatted list, correctly processing the quoted strings and escaping the embedded commas.

Note: When validating the variable inside Data Painter, the expected result is Q1, which represents the first position in the variable list.

Additional Information

This behavior is consistent with Datamaker design and is the standard way to handle lists with embedded commas in variables.