Dynamically adding table rows when publishing XML
search cancel

Dynamically adding table rows when publishing XML

book

Article ID: 142520

calendar_today

Updated On:

Products

CA Test Data Manager (Data Finder / Grid Tools)

Issue/Introduction

To produce the following XML where only one EmployerName tag row exists for each ‘Data Record’,

  • what is the TDM Publish - Table Count formula for ‘EmployerName’?
  • what is the TDM Data Painter formula for ‘EmployerNameText’?

<DataRecord>
     <DataRecord1>                                                                      
          <EmployeeNumber>xxx</EmployeeNumber>                                            
          <EmployerNumber>nnn</EmployerNumber>
          <EmployerName>
                 <EmployerNameText>Employee1</EmployerNameText>
          </EmployerName>  
     </DataRecord1>
     <DataRecord2>                                                                      
          <EmployeeNumber>yyy</EmployeeNumber>                                                           
          <EmployerNumber>zzz</EmployerNumber>
          <EmployerName>
                 <EmployerNameText>Employee2</EmployerNameText>
           </EmployerName>
     </DataRecord2>
</DataRecord> 

If the TDM Publish – Table Count formula for ‘EmployerName’ = 1, this is published XML (‘EmployerName’ tag is missing for Data Record2):

<DataRecord>
     <DataRecord1>                                                                      
          <EmployeeNumber>xxx</EmployeeNumber>                                            
          <EmployerNumber>nnn</EmployerNumber>
          <EmployerName>
                 <EmployerNameText>Employee1</EmployerNameText>
          </EmployerName> 
     </DataRecord1>
     <DataRecord2>                                                                      
          <EmployeeNumber>yyy</EmployeeNumber>                                                           
          <EmployerNumber>zzz</EmployerNumber>
     </DataRecord2>
</DataRecord>               

If the TDM Publish – Table Count formula for ‘Employer Name’ = 2, this is the published XML (‘EmployerName’ tag for Data Record2 is listed for DataRecord1 instead of DataRecord2):

<DataRecord>
     <DataRecord1>                                                                      
          <EmployeeNumber>xxx</EmployeeNumber>                                            
          <EmployerNumber>nnn</EmployerNumber>
          <EmployerName>
                 <EmployerNameText>Employee1</EmployerNameText>
          </EmployerName> 
          <EmployerName>
                 <EmployerNameText>Employee2</EmployerNameText>
           </EmployerName>
     </DataRecord1>
     <DataRecord2>                                                                      
          <EmployeeNumber>yyy</EmployeeNumber>                                                           
          <EmployerNumber>zzz</EmployerNumber>
     </DataRecord2>
</DataRecord> 

Environment

Test Data Manager
TDM Portal

Resolution

We found and fixed the issue by comparing the Generator with the hard-coded table values, to the Generator with the dynamically added table values.
We forgot to change the last field in the table from ^xxx.SHRED_ID(1)^ to ^xxx.SHRED_ID(~ROWNUM~)^.