System.Exception: Unknown expression: Agent. Part: Agent.

Status
Not open for further replies.

ManishNayak

Forum User
Joined
Oct 5, 2020
Messages
2
Reaction score
0
1601897662178.png

System.Exception: Unknown expression: Agent. Part: Agent.
at TcxLexicalParser.ValueManager.GetByPath(String[] path)
at TcxLexicalParser.LexEvaluator.Process(Element element, IValueManager valueManager, Boolean isFunctionArgument)
at CrmIntegration.EscapedExpressionEvaluator.ParseExpression(String expression, Boolean asExpression, IValueManager customManager)
at CrmIntegration.CrmIntegrationTemplateExtensions.Evaluate(RequestValue value, ProcessingContext context, IValueManager customManager)
at CrmIntegration.ScenarioProcessorBase.CreateJsonFromPostValues(RequestItem requestItem, IValueManager customManager)
at CrmIntegration.ScenarioProcessorBase.ProcessRequest(ScenarioRequest request, IValueManager customManager, HttpClient client, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.ProcessScenario(ProtocolScenario scenario, IValueManager customManager, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.ProcessMatching(ProtocolScenario scenario, MatchingPath matching, ResponseMatcher responseMatcher, IValueManager customManager, HashSet`1 distinctMatchings, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.ProcessFoundMatchings(ProtocolScenario scenario, IValueManager customManager, List`1 matchings, ResponseMatcher responseMatcher, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.ProcessScenario(ProtocolScenario scenario, IValueManager customManager, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.Execute(ProtocolScenario scenario, CancellationToken token)
at CrmIntegration.CrmProcessor.GetContactInfoFromCrm(String contactNumber, String destinationEmail, Boolean createIfNotFound, CancellationToken token)
 
I would need to see the template, but quite sure you're invoking the ReportCall scenario from the contact lookup scenario, and the variable [Agent] is not available in that case...
 
  • Like
Reactions: Evolute IT
I would need to see the template, but quite sure you're invoking the ReportCall scenario from the contact lookup scenario, and the variable [Agent] is not available in that case...
<?xml version="1.0"?>
<Crm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Country="US" Name="KONDESK" Version="1">
<Number Prefix="Off" MaxLength="10" />
<Connection MaxConcurrentRequests="2" />
<Parameters>
<Parameter Name="APIkey" Type="String" Parent="General Configuration" Editor="String" Title="API Key:" />
<Parameter Name="CreateContactEnabled" Type="Boolean" Editor="String" Title="Enable Contact Creation" Default="False" />
<Parameter Name="CreateContactFirstName" Type="String" Parent="CreateContactEnabled" Editor="String" Title="New Contact First Name:" Default="New" />
<Parameter Name="CreateContactLastName" Type="String" Parent="CreateContactEnabled" Editor="String" Title="New Contact Last Name:" Default="3CX Contact [Number]" />
<Parameter Name="ReportCallEnabled" Type="Boolean" Editor="String" Title="Enable Call Journaling" Default="True" />
<Parameter Name="Subject" Type="String" Parent="ReportCallEnabled" Editor="String" Title="Call Subject:" Default="3CX PhoneSystem Call" />
<Parameter Name="InboundCallText" Type="String" Parent="ReportCallEnabled" Editor="String" Title="Answered Inbound Call:" Default="[DateTime]: Answered incoming call from [Number] to [Agent] ([Duration])" />
<Parameter Name="MissedCallText" Type="String" Parent="ReportCallEnabled" Editor="String" Title="Missed Call:" Default="[DateTime]: Missed call from [Number] to [Agent]" />
<Parameter Name="OutboundCallText" Type="String" Parent="ReportCallEnabled" Editor="String" Title="Answered Outbound Call:" Default="[DateTime]: Answered outgoing call from [Agent] to [Number] ([Duration])" />
<Parameter Name="NotAnsweredOutboundCallText" Type="String" Parent="ReportCallEnabled" Editor="String" Title="Unanswered Outbound Call:" Default="[DateTime]: Unanswered outgoing call from [Agent] to [Number]" />
</Parameters>
<Authentication Type="No" />
<Scenarios>
<Scenario Id="" Type="REST">
<Request SkipIf="" Url="http://example.com/search?phonenumber=[Number]&amp;companyid=54&amp;branchid=0" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
<Rules>
<Rule Type="Any">contact.id</Rule>
</Rules>
<Variables>
<Variable Name="ContactID" Path="contact.id">
<Filter />
</Variable>
<Variable Name="FirstName" Path="contact.firstname">
<Filter />
</Variable>
<Variable Name="Email" Path="contact.email">
<Filter />
</Variable>
<Variable Name="PhoneMobile" Path="contact.mobilephone">
<Filter />
</Variable>
<Variable Name="CustomValue" Path="contact.customvalue">
<Filter />
</Variable>
</Variables>
<Outputs Next="ReportCall" AllowEmpty="false">
<Output Type="ContactID" Passes="0" Value="[ContactID]" />
<Output Type="FirstName" Passes="0" Value="[FirstName]" />
<Output Type="Email" Passes="0" Value="" />
<Output Type="PhoneMobile" Passes="0" Value="[PhoneMobile]" />
<Output Type="CustomValue" Passes="0" Value="[CustomValue]" />
<Output Type="ContactUrl" Passes="0" Value="http://example.com/show?contactid=[ContactID]" />
</Outputs>
</Scenario>
<Scenario Id="ReportCall" Type="REST">
<Request SkipIf="[ReportCallEnabled]!=True" Url="http://example.com/createcall" MessagePasses="0" Message="" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
<PostValues Key="">
<Value Key="CallType" Passes="1" Type="String">[CallType::CallType]</Value>
<Value Key="Number" Passes="1" Type="String">[Number::Number]</Value>
<Value Key="Agent" Passes="1" Type="String">[Agent::Agent]</Value>
<Value Key="DateTime" Passes="1" Type="String">[DateTime::DateTime]</Value>
<Value Key="DurationMinutes" Passes="1" Type="Integer">[[[DurationTimespan::DurationTimespan].get_TotalMinutes()].ToString("F0")]</Value>
<Value Key="DurationSeconds" Passes="1" Type="Integer">[[[DurationTimespan::DurationTimespan].get_TotalSeconds()].ToString("F0")]</Value>
<Value Key="CallStartTimeUTC" Passes="1" Type="String">[CallStartTimeUTC::CallStartTimeUTC]</Value>
<Value Key="CallEndTimeUTC" Passes="1" Type="String">[CallEndTimeUTC::CallEndTimeUTC]</Value>
<Value Key="CallText" Passes="2" Type="String">[InboundCallText::InboundCallText][MissedCallText::MissedCallText][OutboundCallText::OutboundCallText][NotAnsweredOutboundCallText::NotAnsweredOutboundCallText]</Value>
</PostValues>
</Request>
<Variables>
<Variable Name="CallType" LookupValue="[CallType]" Path="[CallType]">
<Filter />
</Variable>
<Variable Name="Agent" LookupValue="[Agent]" Path="[Agent]">
<Filter />
</Variable>
<Variable Name="DateTime" LookupValue="[DateTime]" Path="[DateTime]">
<Filter />
</Variable>
<Variable Name="CallStartTimeUTC" LookupValue="[CallStartTimeUTC]" Path="[CallStartTimeUTC]">
<Filter />
</Variable>
<Variable Name="CallEndTimeUTC" LookupValue="[CallEndTimeUTC]" Path="[CallEndTimeUTC]">
<Filter />
</Variable>
<Variable Name="InboundCallText" LookupValue="[InboundCallText]" Path="[InboundCallText]">
<Filter />
</Variable>
<Variable Name="MissedCallText" LookupValue="[MissedCallText]" Path="[MissedCallText]">
<Filter />
</Variable>
<Variable Name="OutboundCallText" LookupValue="[OutboundCallText]" Path="[OutboundCallText]">
<Filter />
</Variable>
<Variable Name="NotAnsweredOutboundCallText" LookupValue="[NotAnsweredOutboundCallText]" Path="[NotAnsweredOutboundCallText]">
<Filter />
</Variable>
<Variable Name="DurationTimespan" LookupValue="[DurationTimespan]" Path="[DurationTimespan]">
<Filter />
</Variable>
</Variables>
<Outputs Next="ReportCallMissed" AllowEmpty="true" />
</Scenario>
</Scenarios>
</Crm>
 
As I said, you're invoking the ReportCall scenario from the contact lookup scenario, here:
<Outputs Next="ReportCall" AllowEmpty="false">

You can't do that.
 
  • Like
Reactions: Evolute IT
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,324
Messages
591,897
Members
165,476
Latest member
awan05