search cancel

Data Generation in XLS format with condition on Number of rows to be generated


Article ID: 242000


Updated On:


CA Test Data Manager (Data Finder / Grid Tools)


We have to generate/publish an Excel file with multiple records, but based on the condition of the first record.  If the first record condition is valid, then create 2 records. If the first record condition is not valid, then create only 1 record.

Example: If the first record has a Relationship equal to ’Self’, then only 1 record should be generated. If the Relationship is equal to ’Family’ (Relationship <> ‘Self’, then generate 2 additional records (1st record with Family and 2nd record with Spouse).

When running my generator in TDM Portal, I’m seeing a blank record (Ref: EX:1 – Output). In this case, for the first record, I have “Self”, so only the “Self” records should be created. But I’m seeing a blank record in between the self records.

I have configured my data Generator as follows:

Resulting in:

How can I avoid this issue?


Release : 4.9.1

Component : Web Portal - Generator


Looking at your Data Generator configuration, I see that the Generator is to generate 2 rows of data each time the generator/publish runs. Also, you have configured Row 2/Column 1 to be empty if Row 1/Column1 is "SELF". The Data Generator is publishing exactly what you have configured. If you want Row2 to be a blank line, then configure Columns 2 and 3 in the same manner as Column1.


However, If by 'record', you mean a column is populated, then this might be a better solution, based on the description of your requirements. You can use a macro to define how you would like the additional records to be generated, based on the contents of Column1

Resulting in only 1 record (column 1) getting generated if the record is SELF, and 2 additional records generated if column 1 is FAMILY

Additional Information

For more information, see 'Data Generation Rules - Creating and Managing Variables