CMS Development

ben-duchy
Top Contributor

Web module linked to CRM Object

SOLVE

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 Accepted solutions
LMeert
Solution
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

Web module linked to CRM Object

SOLVE

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 !

View solution in original post

LMeert
Solution
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

Web module linked to CRM Object

SOLVE

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 !

View solution in original post

9 Replies 9
ben-duchy
Top Contributor

Web module linked to CRM Object

SOLVE

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
Top Contributor

Web module linked to CRM Object

SOLVE

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
Solution
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

Web module linked to CRM Object

SOLVE

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
Top Contributor

Web module linked to CRM Object

SOLVE

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
Community Manager
Community Manager

Web module linked to CRM Object

SOLVE

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

Thanks,

Dennis




HubSpot Community Developer ShowMake sure to subscribe to our YouTube channel
where you can find the HubSpot Community Developer Show
0 Upvotes
ben-duchy
Top Contributor

Web module linked to CRM Object

SOLVE

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

dennisedson
Community Manager
Community Manager

Web module linked to CRM Object

SOLVE

You and me both, friend.

Thanks,

Dennis




HubSpot Community Developer ShowMake sure to subscribe to our YouTube channel
where you can find the HubSpot Community Developer Show
0 Upvotes
LMeert
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

Web module linked to CRM Object

SOLVE

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
Solution
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

Web module linked to CRM Object

SOLVE

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 !