- Joined
- Nov 20, 2019
- Messages
- 25
- Reaction score
- 10
Hi,
I am experiencing an issue in which I can't get my Agent lookup to work appropriately with the CRM.
If the agent email searches and returns a UserId, it should journal as that agent in the CRM (Working)
if the agent email is searched and returns no Userid, it should skip that part of the journaling (Not working)
Instead, if there is no match, it fails to journal due to an empty string, can anyone assist? XML Below
I am experiencing an issue in which I can't get my Agent lookup to work appropriately with the CRM.
If the agent email searches and returns a UserId, it should journal as that agent in the CRM (Working)
if the agent email is searched and returns no Userid, it should skip that part of the journaling (Not working)
Instead, if there is no match, it fails to journal due to an empty string, can anyone assist? XML Below
<Scenario Id="ReportCall" Type="REST">
<Request SkipIf="[IIf([ReportCallEnabled]!=True||[EntityId]=="",True,False)]" Url="[restUrl]query/CorporateUser?where=email='[AgentEmail]'&fields=id,name,email&count=500" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" >
<Headers>
<Value Key="BhRestToken">[BhRestToken]</Value>
</Headers>
</Request>
<Rules>
<Rule Type="Any">data.id</Rule>
</Rules>
<Variables>
<Variable Name="UserId" Path="data.id"><Filter /></Variable>
</Variables>
<Outputs Next="CreateCallActivity" AllowEmpty="true" />
</Scenario>
<Scenario Id="CreateCallActivity" Type="REST">
<Request SkipIf="[IIf([ReportCallEnabled]!=True||[EntityId]=="",True,False)]" Url="[restUrl]entity/Note" MessagePasses="0" RequestEncoding="Json" RequestType="Put" ResponseType="Json" >
<Headers>
<Value Key="BhRestToken">[BhRestToken]</Value>
</Headers>
<PostValues>
<Value Key="comments" If="[CallType]==Inbound" Passes="2" Type="String">[[InboundCallText]]</Value>
<Value Key="comments" If="[CallType]==Missed" Passes="2" Type="String">[[MissedCallText]]</Value>
<Value Key="comments" If="[CallType]==Outbound" Passes="2" Type="String">[[OutboundCallText]]</Value>
<Value Key="comments" If="[CallType]==Notanswered" Passes="2" Type="String">[[NotAnsweredOutboundCallText]]</Value>
<Object Key="personReference">
<Value Key="id" Passes="2" Type="Integer">[[EntityId]]</Value>
</Object>
<Object Key="commentingPerson" SkipIf="[UserId]==""">
<Value Key="id" Passes="2" Type="Integer">[[UserId]]</Value>
</Object>
<Value Key="action" If="[CallType]==Inbound" Type="String">Inbound Answered Call</Value>
<Value Key="action" If="[CallType]==Missed" Type="String">Inbound Missed Call</Value>
<Value Key="action" If="[CallType]==Outbound" Type="String">Outbound Answered Call</Value>
<Value Key="action" If="[CallType]==Notanswered" Type="String">Outbound Missed Call</Value>
<Value Key="minutesSpent" If="[IIf([CallType]==Inbound||[CallType]==Outbound,True,False)]" Passes="2" Type="Integer">[[[DurationTimespan].get_TotalSeconds()].ToString("F0")]</Value>
</PostValues>
</Request>
</Scenario>
<Request SkipIf="[IIf([ReportCallEnabled]!=True||[EntityId]=="",True,False)]" Url="[restUrl]query/CorporateUser?where=email='[AgentEmail]'&fields=id,name,email&count=500" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" >
<Headers>
<Value Key="BhRestToken">[BhRestToken]</Value>
</Headers>
</Request>
<Rules>
<Rule Type="Any">data.id</Rule>
</Rules>
<Variables>
<Variable Name="UserId" Path="data.id"><Filter /></Variable>
</Variables>
<Outputs Next="CreateCallActivity" AllowEmpty="true" />
</Scenario>
<Scenario Id="CreateCallActivity" Type="REST">
<Request SkipIf="[IIf([ReportCallEnabled]!=True||[EntityId]=="",True,False)]" Url="[restUrl]entity/Note" MessagePasses="0" RequestEncoding="Json" RequestType="Put" ResponseType="Json" >
<Headers>
<Value Key="BhRestToken">[BhRestToken]</Value>
</Headers>
<PostValues>
<Value Key="comments" If="[CallType]==Inbound" Passes="2" Type="String">[[InboundCallText]]</Value>
<Value Key="comments" If="[CallType]==Missed" Passes="2" Type="String">[[MissedCallText]]</Value>
<Value Key="comments" If="[CallType]==Outbound" Passes="2" Type="String">[[OutboundCallText]]</Value>
<Value Key="comments" If="[CallType]==Notanswered" Passes="2" Type="String">[[NotAnsweredOutboundCallText]]</Value>
<Object Key="personReference">
<Value Key="id" Passes="2" Type="Integer">[[EntityId]]</Value>
</Object>
<Object Key="commentingPerson" SkipIf="[UserId]==""">
<Value Key="id" Passes="2" Type="Integer">[[UserId]]</Value>
</Object>
<Value Key="action" If="[CallType]==Inbound" Type="String">Inbound Answered Call</Value>
<Value Key="action" If="[CallType]==Missed" Type="String">Inbound Missed Call</Value>
<Value Key="action" If="[CallType]==Outbound" Type="String">Outbound Answered Call</Value>
<Value Key="action" If="[CallType]==Notanswered" Type="String">Outbound Missed Call</Value>
<Value Key="minutesSpent" If="[IIf([CallType]==Inbound||[CallType]==Outbound,True,False)]" Passes="2" Type="Integer">[[[DurationTimespan].get_TotalSeconds()].ToString("F0")]</Value>
</PostValues>
</Request>
</Scenario>