May 19, 2022 8:32 AM - edited May 19, 2022 8:33 AM
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?
Solved! Go to Solution.
May 19, 2022 10:25 AM
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 :
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
![]() | CTO @ 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 ! |
May 19, 2022 12:24 PM
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 :
If the attendance isn't showing it's because you made a typo on "attendance".
Simply remove the pprint portion and the ******* line, and change "attandance" for "attendance" and you're all set 🙂
![]() | CTO @ 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 ! |
May 19, 2022 11:24 AM
Hi @LMeert,
Thanks for your help with this.
It has indeed worked, however is it possible to format it better?
Current code below...
May 19, 2022 11:55 AM
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 }}
May 19, 2022 12:24 PM
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 :
If the attendance isn't showing it's because you made a typo on "attendance".
Simply remove the pprint portion and the ******* line, and change "attandance" for "attendance" and you're all set 🙂
![]() | CTO @ 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 ! |
May 19, 2022 2:46 PM
Ah, great spot with the typo! I've corrected the spelling and it now works. Thanks very much... it's been a long day! 😀👍
May 19, 2022 3:05 PM
And off goes my favorite gorilla to code another module. 🦍
May 19, 2022 3:55 PM
@dennisedson my work is never done! Eveytime I complete one project, I find another feature in HubSpot that I need to learn 😂
May 19, 2022 3:56 PM
You and me both, friend.
May 19, 2022 11:46 AM
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 ?
![]() | CTO @ 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 ! |
May 19, 2022 10:25 AM
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 :
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
![]() | CTO @ 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 ! |