Create a Source transformation in the Mapping Designer to read data from Concur.
When you select a Concur V2 connection for a Source transformation in a mapping to read data from Concur, you can select an operation based on version 3.0 of Concur API.
After you specify the configured connection, specify Operations on the Source tab of the Source transformation. The Secure Agent displays operations applicable to the object configured in the connection. You can select the operation that you want to perform.
Select the operation you require, configure the request message in XML from the sample template provided, and configure the advanced properties for the operation. If you want to write to a relational target, define a relational structure for the source data by mapping the incoming fields that is in hierarchical format to the output fields in relational format. When you run the mapping, the Secure Agent retrieves data for the specified operation from Concur.
Configuring a Request Using Request Message Editor
When you create a Source transformation, configure an XML request message for the operation that you want to perform in Concur.
Use the Request Message Editor to create a request message. The request message is in XML format and contains request parameters exposed by Concur API for a specific operation. You can use the default request message for the operation and then customize the request message to specify the data that you want to enter into the data flow.
To customize your request, copy the request message from the sample template to the Request Message Editor pane where you can edit the XML message and add the attributes for the request. Remove unnecessary and empty tags from the request message to avoid operation failure.
For example, you want to perform an operation GetAllReports_INPUT using Concur V2 Connector to retrieve reports created between 1 January 2016 and 31 May 2016 for all users in a single call.
The following XML sample shows the filters used for the GetAllReports_INPUT operation:
<!--1 or more repetitions:--> <INFA:GetAllReports_INPUT xmlns:INFA="http://xml.schemas/infa/procedure/"> <!--Optional:--> <GetAllReports> <user> ALL </user> <createDateBefore> 2016-05-31 </createDateBefore> <!--Optional:--> <createDateAfter> 2016-01-01 </createDateAfter> </GetAllReports> </INFA:GetAllReports_INPUT>
The following image shows the validated request message in a GetAllReports_INPUT operation in the Mapping Designer:
The request message format in Concur V2 Connector follows the service request definition in Concur. Ensure that you use well-formed XML formatting in the request message. You can verify if the XML request is valid to ensure that the XML matches the structure expected by the operation.
Parameterizing the Input Values in a Request Message
You can use in-out parameters to represent input values in a request XML.
Configure the in-out parameters in the Mapping Designer. From the Mapping Design page, you open the parameters panel and configure an in-out parameter.
The following image shows a configured Created_Before in-out parameter value:
After you configure a parameter, use the parameter name in the following format, $$Name, in a request message. The XML uses the fields from the parameterized object.
For example, you want to use parameterized Created_Before and Created_After values in an XML request for a GetAllUsers_INPUT operation.
The following sample request shows the parameterized values that you can specify in an XML request:
<!--1 or more repetitions:--> <INFA:GetAllReports_INPUT xmlns:INFA="http://xml.schemas/infa/procedure/"> <!--Optional:--> <GetAllReports> <user> ALL </user> <createDateBefore> $$Created_Before </createDateBefore> <createDateAfter> $$Created_After </createDateAfter> </GetAllReports> </INFA:GetAllReports_INPUT>
Configuring In-Out Parameters in a Mapping
When you deploy the mapping in a mapping task, you can configure the mapping to run according to a schedule. When the task runs, the Secure Agent replaces the in-out parameter values based on the specified parameters in the expression.
The following image shows a configured parameter used in a mapping task:
In the example, the task overrides the default values and reads reports created between 1 March 2016 to 30 April 2016.
Field Mapping in a Source Transformation
The response message format follows the service response definition in Concur. You can map response fields from a hierarchical to a relational structure of output groups and fields.
After you configure an operation for a source and specify the request message, create the relational format from the hierarchical data to include groups and fields that you want in the output.
To do this, select the elements in the response structure that you want to include as output fields. The Secure Agent converts the XML response in the hierarchical structure to relational groups at run time.
The output groups along with the primary and foreign keys are generated. You can pause on the output field to view the XPath expression, which indicates which field the output field is mapped to in the response structure of the hierarchy tree.
The following image shows an example hierarchical response structure generated from the request XML for the GetAllUsers_INPUT operation and the corresponding relational output fields for the response:
You can edit the data type, precision, and scale for the groups and fields after mapping the fields.
Creating Packed Fields in a Field Mapping
You can reduce the number of output groups for a complex request message by marking fields that you want to pack when you configure the field mapping.
You can pack multiple instances of a single element or a hierarchy of elements into one field. A packed icon displays next to elements marked to be packed, indicating that you can pack the entire element into one output field when you check that element.
Fields can come from the source that are marked for packing. You can unpack fields by clicking the pack icon. You cannot select fields that are descendants of packed fields.
The following image shows the packed DuplicateSearchFields element:
When you run the mapping, the agent packs the element and its descendants into a single XML string. You can view the following packed DuplicateSearchFields in the target file.