000030602 - Configure a Database Query Transporter data feed with a multi-select values list

Document created by RSA Customer Support Employee on Jun 14, 2016Last modified by RSA Customer Support Employee on Apr 21, 2017
Version 5Show Document
  • View in full screen mode

Article Content

Article Number000030602
Applies ToRSA Product Set: Archer
RSA Version/Condition: 5.5 SP1
IssueHello Archer Support:
I need help to configure a Database Query Transporter data feed 
I have configured a Database Query Transporter data feed and everything works OK except a multi-select values list field. The data feed doesn’t understand a semicolon “;” as a value delimiter.
ResolutionThere are two ways to import multiple values into a values list field with a database query datafeed:
Method 1.  Create separate rows in the source database for each values list value.  If you have a values list field called "Color" and you want to import the three values Red, Blue and Green for one record, your database would need three rows. Each would have the same value for the application's key field, with different values for the Color field.
 
Key Field Color
12345Red
12345Blue
12345Green

In the data feed configuration, on the Data Map tab, configure the values list with the setting "Append data to list-based fields."
Field Option "Append Data to List-Based Field"

When the first row is processed, the record "12345" will be added, with the value "Red" in the values list field.
When the second row is processed, record 12345 will be updated and "Blue" will be appended to the existing value in the field.
Processing of the third row will again update the record and add the last value to the end of the list.
Method 2.  Add a customed XML transform to the data feed.  As an alternative to the above, you can add a custom transorm to the data feed (on the Navigation tab) to modify the structure of the source XML data.  An example is shown below.  In this transform, you would replace "FieldName" with the actual name of your values list field.
<?xml version="1.0"?> 
<xsl:stylesheet version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" xmlns="http://www.archer-tech.com/"> 
  <xsl:output method="xml" indent="yes"/> 
 
  <xsl:template match="NewDataSet"> 
       <ArcherRecords> 
            <xsl:apply-templates select="Table"/> 
       </ArcherRecords> 
  </xsl:template> 
 
  <xsl:template match="*"> 
       <xsl:element name="{local-name()}"> 
            <xsl:copy-of select="@*"/> 
            <xsl:apply-templates/> 
       </xsl:element> 
  </xsl:template> 
 
  <xsl:template match="NewDataSet/Table/FieldName"> 
       <xsl:element name="{local-name()}"> 
            <xsl:call-template name="outputValues"> 
                 <xsl:with-param name="list" select="."/> 
                 <xsl:with-param name="del">;</xsl:with-param> 
            </xsl:call-template> 
       </xsl:element> 
  </xsl:template> 
 
  <xsl:template name="outputValues"> 
       <xsl:param name="list"/> 
       <xsl:param name="del"/> 
       <!-- GET EVERYTHING IN FRONT OF THE FIRST DELIMETER --> 
       <xsl:variable name="first" select="substring-before($list,$del)"></xsl:variable> 
       <!-- STORE ANYTHING LEFT IN ANOTHER VARIABLE --> 
       <xsl:variable name="remaining" select="substring-after($list,$del)"></xsl:variable> 
       <xsl:choose> 
            <xsl:when test="$first != ''"> 
                 <item> 
                      <xsl:value-of select="$first"/> 
                 </item> 
                 <!-- CHECK TO SEE IF ANYTHING IS LEFT --> 
                 <xsl:if test="$remaining"> 
                      <!-- CALL THE TEMPLATE AGAIN USING THE NEW VARIABLE  FOR THE PARAMETER --> 
                      <xsl:call-template name="outputValues"> 
                           <xsl:with-param name="list" select="$remaining"></xsl:with-param> 
                           <xsl:with-param name="del">;</xsl:with-param> 
                      </xsl:call-template> 
                 </xsl:if> 
            </xsl:when> 
            <xsl:otherwise> 
                 <item> 
                      <xsl:value-of select="$list"/> 
                 </item> 
            </xsl:otherwise> 
       </xsl:choose> 
  </xsl:template> 
</xsl:stylesheet>

 

Outcomes