TCC – Custom Function WM_CONCAT
We’ve all had those times when we want to export the user types or groups and return the selections on the same line as opposed to each type and group on a different line. Yes you could use csv-entity export but that’s never a sure thing. You can use WM_CONCAT to pull the elements and stick them in the same column as comma separated value. This is a bit limited because you have include a grouping for every value not using WM_CONCAT.
Here is a functional demonstration:
Create an empty file named: UserExport-WM_CONCAT_sq.xml
Add this code to the file:
<?xml version="1.0" encoding="UTF-8"?>
<quer:query productCode="SO1704" model="http://www.taleo.com/ws/so800/2009/01" projectedClass="User" locale="en" mode="CSV" csvheader="true" largegraph="true" preventDuplicates="false" xmlns:quer="http://www.taleo.com/ws/integration/query">
<quer:subQueries/>
<quer:projections>
<quer:projection>
<quer:field path="UserAccount,Loginname"/>
</quer:projection>
<quer:projection>
<quer:field path="FirstName"/>
</quer:projection>
<quer:projection>
<quer:field path="LastName"/>
</quer:projection>
<quer:projection>
<quer:field path="CorrespondenceEmail"/>
</quer:projection>
<quer:projection alias="UserTypeCode" projectedValueType="[C">
<quer:customFunction name="wm_concat">
<quer:field path="UserTypes,Code"/>
</quer:customFunction>
</quer:projection>
</quer:projections>
<quer:projectionFilterings/>
<quer:filterings/>
<quer:sortings>
<quer:sorting ascending="true">
<quer:field path="LastName"/>
</quer:sorting>
<quer:sorting ascending="true">
<quer:field path="FirstName"/>
</quer:sorting>
</quer:sortings>
<quer:sortingFilterings/>
<quer:groupings>
<quer:grouping>
<quer:field path="UserAccount,Loginname"/>
</quer:grouping>
<quer:grouping>
<quer:field path="FirstName"/>
</quer:grouping>
<quer:grouping>
<quer:field path="LastName"/>
</quer:grouping>
<quer:grouping>
<quer:field path="CorrespondenceEmail"/>
</quer:grouping>
</quer:groupings>
<quer:joinings/>
</quer:query>