reuse::partial$beta-banner.adoc
This section of the tutorial teaches you how to extract information from the payload into different variables to refer to those values later in the flow.
Complete these procedures:
-
Configure your Salesforce integration.
-
In Anypoint Code Builder, open your
new-case-salesforce.xmlfile. -
Click the
(Add component) icon after the On New Case Salesforce component: -
Type
Transformand select Transform. -
Configure the Transform Message component to extract data from the payload to variables:
<ee:transform doc:name="Extract Values from Case" > <ee:variables> <ee:set-variable variableName="casestatus"> //(1) <![CDATA[%dw 2.0 output application/java --- payload.Status]]> </ee:set-variable> <ee:set-variable variableName="casenumber"> //(2) <![CDATA[%dw 2.0 output application/java --- payload.CaseNumber]]> </ee:set-variable> <ee:set-variable variableName="slackchannel"> //(3) <![CDATA["this-is-a-test"]]> </ee:set-variable> </ee:variables> </ee:transform>
-
casestatusretrieves the Salesforce case status: New, Working, or Escalated. -
casenumberretrieves the case number created by Salesforce. -
Set the
slackchannelto the channel name that you set earlier in the tutorial.
-
Add a Set Payload component to concatenate the value of your variables in the resulting payload of your application:
-
Click the
(Add component) icon after the Transform Message component: -
Type
setand select Set Payload. -
Configure the Set Payload component with the following code:
<set-payload doc:name="Set Case Info" value='#["Case Number: " ++ (payload.CaseNumber default "") ++ ", Origin: " ++ (payload.Origin default "") ++ ", Case Type: " ++ (payload.Type default "") ++ ", Priority: " ++ (payload.Priority default "") ++ ", Status: " ++ (payload.Status default "")]'/>
-
Proceed to tut-slack-add-condition-to-your-flow.adoc to create a condition to send an email if the case is escalated or otherwise inform about the case in a Slack channel.

