Website/Landing page that fetches and write data to CRM
SOLVE
Hello,
I have a complex scenario that i am trying to solve. Basically what we require is a website/landing page, that can fetch and display data based on a contact ID that is passed in the URL as a parameter maybe. Another section of this page would be able to write data to the CRM (I was thinking of embedding a form for the same).
So to sum it up, i'll give a live scenario that we are expecting: 1) Share a link with a contact 2) Display the data fetched form inside this contact (and from associated objects if possible) 3) If this contact fills the input fields, update the properties related to this contact.
In your opinion, what is the best practice to achieve this?
Check out this page of the docs. You should be able to use the `crm_object` and `crm_associations` functions. For the form, I would advise you to use a default HubSpot form and add contact properties and other object properties to the form. You are not limited to only using contact properties in your form.
Learn more about HubSpot by following me on LinkedIn or YouTube
✅ Did my answer solve your issue? Help the community by marking it as the solution.
This is what i have in my module so far. i am able to fetch the property values for the contact passed in the dynamic page, but for the associated deals to this contact, it is diplaying nothing. I even tried to pass the contact id directly in the code to test, but still no luck:
1. Your definition ID of the association is correct.
2. It is a HubSpot-defined association, so that is correct as well.
This leaves the contact ID itself. If you use {{contact_id|pprint}} does it show a correct value? And if you use {{deals|pprint}}, what does that give you? And if you paste the contact ID directly as a string in the function, does that change anything? {% set deals = crm_associations("1234","HUBSPOT_DEFINED", 4) %}
{{deals|pprint}}
You could also try this:
{% set deals = crm_associations(contact_id,"HUBSPOT_DEFINED", 4, "limit=50", "customer_full_name", false) %}
Because it could be that you need to retrieve the specific property.
Learn more about HubSpot by following me on LinkedIn or YouTube
✅ Did my answer solve your issue? Help the community by marking it as the solution.
I tried dynamic pages, but went through some issues configuring the page slug. I picked contact record id as the page slug, but wasn't able to configure it / pass it to the page to display accordingly.
Are you aware if i can access the associated objects of the contact i am fetching to the page?