Skipped Scenario overwrites outputs

Status
Not open for further replies.

royalvt

Customer
Advanced Certified
Joined
Jun 1, 2020
Messages
4
Reaction score
1
I have a chain of scenarios, where if the first method retrieves a contact with an contactID of 0, it will run the following scenario to lookup via a different method. This part works fine, however if the contact ID from the first scenario is valid, and the 2nd scenario is skipped, it will change the contactID to a null value. I have not been able to figure out how to prevent this from happening.


<Scenario Id="" Type="REST">
<Request Url="https://.../api/CustomerContact?$top=1&amp;$filter=contains(Phone,%20%27[Number]%27)" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
<Rules>
<Rule Type="Any">CustomerId</Rule>
</Rules>
<Variables>
<Variable Name="CustomerId" Path="CustomerId">
<Filter />
</Variable>
<Variable Name="ContactId" Path="CustomerContactId">
<Filter />
</Variable>
<Variable Name="FirstName" Path="FirstName">
<Filter />
</Variable>
<Variable Name="LastName" Path="LastName">
<Filter />
</Variable>
<Variable Name="Email" Path="Email">
<Filter />
</Variable>
</Variables>
<Outputs Next="CustomerPhoneLookup" AllowEmpty="true" />
</Scenario>
<Scenario Id="CustomerPhoneLookup" Type="REST">
<Request SkipIf="[CustomerId]!=0" Url="https://.../api/app/customers?$top=1&amp;$filter=contains(Phone,%20%27[Number]%27)" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
<Rules>
<Rule Type="Any">CustomerId</Rule>
</Rules>
<Variables>
<Variable Name="CustomerId" Path="CustomerId">
<Filter />
</Variable>
</Variables>
<Outputs Next="CustomerLookup" AllowEmpty="true" />
</Scenario>
<Scenario Id="CustomerLookup" Type="REST">
<Request SkipIf="" Url="https://.../api/app/customers/[CustomerId]" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
<Rules>
<Rule Type="Any">CustomerId</Rule>
</Rules>
<Variables>
<Variable Name="CompanyName" Path="Name">
<Filter />
</Variable>
<Variable Name="CustomerNumber" Path="CustomerNumber">
<Filter />
</Variable>
<Variable Name="PhoneBusiness" Path="Phone">
<Filter />
</Variable>
</Variables>
<Outputs AllowEmpty="false">
<Output Type="ContactID" Passes="0" Value="[ContactID]" />
<Output Type="FirstName" Passes="0" Value="[FirstName]" />
<Output Type="LastName" Passes="0" Value="[LastName]" />
<Output Type="CompanyName" Passes="0" Value="[CustomerNumber]:[CompanyName]" />
<Output Type="Email" Passes="0" Value="" />
<Output Type="PhoneBusiness" Passes="0" Value="[PhoneBusiness]" />
<Output Type="ContactUrl" Passes="0" Value="..../Sedona%20Contact#phone=[Number]" />
<Output Type="EntityId" Passes="0" Value="[ContactId]" />
<Output Type="EntityType" Passes="0" Value="Contacts" />
</Outputs>
</Scenario>
 
Please note that [ContactID] and [ContactId] are 2 different things. Ensure that you use the same case everywhere to avoid confusions.
 
  • Like
Reactions: Evolute IT
Status
Not open for further replies.