CMS Development

ben-duchy
Stratege/Strategin

Web module linked to CRM Object

lösung

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 Upvotes
2 Akzeptierte Lösungen
LMeert
Lösung
Ratgeber/-in | Platinum Partner
Ratgeber/-in | Platinum Partner

Web module linked to CRM Object

lösung

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 !

Lösung in ursprünglichem Beitrag anzeigen

LMeert
Lösung
Ratgeber/-in | Platinum Partner
Ratgeber/-in | Platinum Partner

Web module linked to CRM Object

lösung

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 !

Lösung in ursprünglichem Beitrag anzeigen

9 Antworten
ben-duchy
Stratege/Strategin

Web module linked to CRM Object

lösung

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 Upvotes
ben-duchy
Stratege/Strategin

Web module linked to CRM Object

lösung

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 Upvotes
LMeert
Lösung
Ratgeber/-in | Platinum Partner
Ratgeber/-in | Platinum Partner

Web module linked to CRM Object

lösung

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
Stratege/Strategin

Web module linked to CRM Object

lösung

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 Upvotes
dennisedson
HubSpot-Produktteam
HubSpot-Produktteam

Web module linked to CRM Object

lösung

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

0 Upvotes
ben-duchy
Stratege/Strategin

Web module linked to CRM Object

lösung

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

dennisedson
HubSpot-Produktteam
HubSpot-Produktteam

Web module linked to CRM Object

lösung

You and me both, friend.

0 Upvotes
LMeert
Ratgeber/-in | Platinum Partner
Ratgeber/-in | Platinum Partner

Web module linked to CRM Object

lösung

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
Lösung
Ratgeber/-in | Platinum Partner
Ratgeber/-in | Platinum Partner

Web module linked to CRM Object

lösung

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 !