Hubspot Contact Creation - Inbound Calls Only

markymark543

Customer
Joined
Sep 29, 2023
Messages
10
Reaction score
1
I am using an old Hubspot template to automatically create Hubspot contacts as inbound calls come in.

I have set up the custom XML file per the instructions posted here:
https://www.3cx.com/community/threads/hubspot-not-showing-all-calls.122311/#post-573343

My goal is to get the contact creation working based on the incoming call and not the agent clicking to add the contact.

The problem is that 3cx is creating a new contact based on outbound calls as well. Is there any way to limit this to inbound calls only?
 
I am using an old Hubspot template to automatically create Hubspot contacts as inbound calls come in.

I have set up the custom XML file per the instructions posted here:
https://www.3cx.com/community/threads/hubspot-not-showing-all-calls.122311/#post-573343

My goal is to get the contact creation working based on the incoming call and not the agent clicking to add the contact.

The problem is that 3cx is creating a new contact based on outbound calls as well. Is there any way to limit this to inbound calls only?
Yes, you need to use the SkipIf attribute to skip the scenario on outbound calls.
SkipIf="[IIf([CallDirection]==Outbound,True,False)]"
 
Inside the Request element that you have inside the CreateContactRecord scenario.
<Request SkipIf.....
 
  • Like
Reactions: Evolute IT
How would you do if there's already a skipif element?

Code:
   <Scenario Id="CreateContactRecordFromClient" Type="REST" EntityId="" EntityOrder="">
      <Request SkipIf="[CreateContactEnabled]!=True" Url="https://api.hubapi.com/crm/v3/objects/contacts" MessagePasses="0" Message="" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
        <PostValues Key="" If="" SkipIf="">
          <Object Key="properties" If="" SkipIf="">
            <Value Key="firstname" If="" SkipIf="" Passes="0" Type="String">[FirstName]</Value>
            <Value Key="lastname" If="" SkipIf="" Passes="0" Type="String">[LastName]</Value>
            <Value Key="email" If="[Email]!=&quot;&quot;" SkipIf="" Passes="0" Type="String">[Email]</Value>
            <Value Key="mobilephone" If="[Number]!=&quot;&quot;" SkipIf="" Passes="0" Type="String">[Number]</Value>
            <Value Key="company" If="[Company]!=&quot;&quot;" SkipIf="" Passes="0" Type="String">[Company]</Value>
          </Object>
        </PostValues>
      </Request>
      <Rules>
        <Rule Type="Any" Ethalon="">id</Rule>
      </Rules>
      <Variables>
        <Variable Name="ContactID" LookupValue="" Path="id"><Filter /></Variable>
      </Variables>
      <Outputs AllowEmpty="false">
        <Output Type="FirstName" Passes="0" Value="[FirstName]" />
        <Output Type="LastName" Passes="0" Value="[LastName]" />
        <Output Type="CompanyName" Passes="0" Value="[Company]" />
        <Output Type="Email" Passes="0" Value="[Email]" />
        <Output Type="PhoneMobile" Passes="0" Value="[Number]" />
        <Output Type="EntityId" Passes="0" Value="[ContactID]" />
        <Output Type="EntityType" Passes="0" Value="Contacts" />
        <Output Type="ContactUrl" Passes="0" Value="https://[HubSpotDomain]/contacts/[PortalID]/contact/[ContactID]" />
      </Outputs>
    </Scenario>
 
@edossantos_sipcaller I tried this but it doesn't work:

Code:
<Request SkipIf="[CreateContactEnabled]!=True OR [IIf([CallDirection]==Outbound,True,False)]" Url="https://api.hubapi.com/crm/v3/objects/contacts" MessagePasses="0" Message="" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
 
No, that OR will not work. You need to use the following expression:
SkipIf="[CreateContactEnabled]!=True||[IIf([CallDirection]==Outbound,True,False)]==True"
 
  • Like
Reactions: Evolute IT
@edossantos_sipcaller this is what I did but it's still not working

Code:
<Request SkipIf="[CreateContactEnabled]!=True||[IIf([CallDirection]==Outbound,True,False)]==True" Url="https://api.hubapi.com/crm/v3/objects/contacts" MessagePasses="0" Message="" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
 
What error do you see now? You need to enable verbose logs, try to create a contact, and check the 3cxManagementConsole.log file, that's where 3CX writes during contact creation. You will find some hints there.
 
No errors. The contact is being created on an outbound call.
 
Wait, but you're using the scenario named "CreateContactRecordFromClient", is this being requested by the agent from the Web Client? Or you're trying to automatically trigger this from another scenario? In this second case, how are you doing this?
 
  • Like
Reactions: Evolute IT

Forum statistics

Threads
112,147
Messages
590,961
Members
165,167
Latest member
Finatra.us