CMS Development

ben-duchy
Colaborador líder

Web module linked to CRM Object

resolver

Has anyone had any experience creating web modules that pull the data directly from a CRM object instead of HubDB?

 

I've used this guide that works, but it makes no mention of select list items. I can only get it to pull in data that are stored in text boxes for example {{ event.name }}

 

When data is set within an object select list for example {{ event.region }} the results are blank! I assume I need to add something to this code snippet?

0 Me gusta
2 Soluciones aceptadas
LMeert
Solución
Guía | Partner nivel Platinum
Guía | Partner nivel Platinum

Web module linked to CRM Object

resolver

Hi @ben-duchy,

 

I assume you're having problems pulling values from dropdown select fields, is that correct ?

You can try, instead of querying the whole object, to specify the properties you want to return like this :

LMeert_0-1652970196860.png

 

I've just tried it and it works, when querying your object, specify the properties by adding them in the crm_object() function. You have to list the properties' internal name, between quotes and separated by commas.

 

Hope this helps !
If it does, please consider marking this answer as a solution 🙂

 

Best,

Ludwig 

Agence Mi4 - Data DrivenCTO @ Mi4
Hubspot Platinum Partner and Integration Expert

Passionate human, very curious about everything data and automation.

Any problem with Hubspot you need help solving ?

Let me know !

Ver la solución en mensaje original publicado

LMeert
Solución
Guía | Partner nivel Platinum
Guía | Partner nivel Platinum

Web module linked to CRM Object

resolver

I don't understand, isn't your for loop doing so ?

By invoking the crm_object function, you created a list of events with name and attendance properties.

Then you loop on your event object and display, for each item, both properties :

LMeert_0-1652977402138.png

If the attendance isn't showing it's because you made a typo on "attendance".

LMeert_1-1652977449085.png

 

Simply remove the pprint portion and the ******* line, and change "attandance" for "attendance" and you're all set 🙂

 

Agence Mi4 - Data DrivenCTO @ Mi4
Hubspot Platinum Partner and Integration Expert

Passionate human, very curious about everything data and automation.

Any problem with Hubspot you need help solving ?

Let me know !

Ver la solución en mensaje original publicado

9 Respuestas 9
ben-duchy
Colaborador líder

Web module linked to CRM Object

resolver

Hi @LMeert,

 

Thanks for your help with this.

It has indeed worked, however is it possible to format it better?

Current code below...


object.jpg

0 Me gusta
ben-duchy
Colaborador líder

Web module linked to CRM Object

resolver

You're right CSS can take care of any styling issues, but at the moment my goal is to learn the basics and remove any excess content.

 

Your pprint method has allowed me to show everything including the select list data (the 'yes' on the last item), but I only need to show the event name and attendance fields and not the ID's etc.

 

Is there anything similar to pprint but only for specific fields? It's like I need something along the lines of the hubdb equivalent {{ row["event_attendance"].name }}

0 Me gusta
LMeert
Solución
Guía | Partner nivel Platinum
Guía | Partner nivel Platinum

Web module linked to CRM Object

resolver

I don't understand, isn't your for loop doing so ?

By invoking the crm_object function, you created a list of events with name and attendance properties.

Then you loop on your event object and display, for each item, both properties :

LMeert_0-1652977402138.png

If the attendance isn't showing it's because you made a typo on "attendance".

LMeert_1-1652977449085.png

 

Simply remove the pprint portion and the ******* line, and change "attandance" for "attendance" and you're all set 🙂

 

Agence Mi4 - Data DrivenCTO @ Mi4
Hubspot Platinum Partner and Integration Expert

Passionate human, very curious about everything data and automation.

Any problem with Hubspot you need help solving ?

Let me know !

ben-duchy
Colaborador líder

Web module linked to CRM Object

resolver

Ah, great spot with the typo! I've corrected the spelling and it now works. Thanks very much... it's been a long day! 😀👍

0 Me gusta
dennisedson
Equipo de producto de HubSpot
Equipo de producto de HubSpot

Web module linked to CRM Object

resolver

And off goes my favorite gorilla to code another module.  🦍

0 Me gusta
ben-duchy
Colaborador líder

Web module linked to CRM Object

resolver

@dennisedson my work is never done! Eveytime I complete one project, I find another feature in HubSpot that I need to learn  😂

dennisedson
Equipo de producto de HubSpot
Equipo de producto de HubSpot

Web module linked to CRM Object

resolver

You and me both, friend.

0 Me gusta
LMeert
Guía | Partner nivel Platinum
Guía | Partner nivel Platinum

Web module linked to CRM Object

resolver

No worries @ben-duchy,

 

The design can of course be improved, but that's a matter of CSS I'd say.

What would you like to improve ?

Agence Mi4 - Data DrivenCTO @ Mi4
Hubspot Platinum Partner and Integration Expert

Passionate human, very curious about everything data and automation.

Any problem with Hubspot you need help solving ?

Let me know !

LMeert
Solución
Guía | Partner nivel Platinum
Guía | Partner nivel Platinum

Web module linked to CRM Object

resolver

Hi @ben-duchy,

 

I assume you're having problems pulling values from dropdown select fields, is that correct ?

You can try, instead of querying the whole object, to specify the properties you want to return like this :

LMeert_0-1652970196860.png

 

I've just tried it and it works, when querying your object, specify the properties by adding them in the crm_object() function. You have to list the properties' internal name, between quotes and separated by commas.

 

Hope this helps !
If it does, please consider marking this answer as a solution 🙂

 

Best,

Ludwig 

Agence Mi4 - Data DrivenCTO @ Mi4
Hubspot Platinum Partner and Integration Expert

Passionate human, very curious about everything data and automation.

Any problem with Hubspot you need help solving ?

Let me know !