# Web module linked to CRM Object

**URL:** <https://community.hubspot.com/t/web-module-linked-to-crm-object/57292>\
**Category:** CMS Development\
**Created:** [May 19, 2022, 12:32pm UTC](https://community.hubspot.com/t/web-module-linked-to-crm-object/57292 "2022-05-19T12:32:50Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben-duchy](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ben-duchy/32/84083_2.png) [@ben-duchy](https://community.hubspot.com/u/ben-duchy)\
**Post date:** [May 19, 2022, 12:32pm UTC](https://community.hubspot.com/t/web-module-linked-to-crm-object/57292/1 "2022-05-19T12:32:50Z")

</div>

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](https://developers.hubspot.com/docs/cms/guides/dynamic-pages/crm-objects) 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?

---

<div class="post-metadata">

**Author:** ![LMeert](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/lmeert/32/103847_2.png) [@LMeert](https://community.hubspot.com/u/LMeert)\
**Post date:** [May 19, 2022, 2:25pm UTC](https://community.hubspot.com/t/web-module-linked-to-crm-object/57292/2 "2022-05-19T14:25:04Z")

</div>

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](https://d2qpr2jzcazej7.cloudfront.net/original/3X/f/7/f788fa83200d1719979ad7d605c2389ab3a265d7.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

---

<div class="post-metadata">

**Author:** ![ben-duchy](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ben-duchy/32/84083_2.png) [@ben-duchy](https://community.hubspot.com/u/ben-duchy)\
**Post date:** [May 19, 2022, 3:24pm UTC](https://community.hubspot.com/t/web-module-linked-to-crm-object/57292/3 "2022-05-19T15:24:15Z")

</div>

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](https://d2qpr2jzcazej7.cloudfront.net/original/3X/9/e/9e6f6b24d502714170e9b8a099e79033f9dd796a.jpeg)

---

<div class="post-metadata">

**Author:** ![LMeert](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/lmeert/32/103847_2.png) [@LMeert](https://community.hubspot.com/u/LMeert)\
**Post date:** [May 19, 2022, 3:46pm UTC](https://community.hubspot.com/t/web-module-linked-to-crm-object/57292/4 "2022-05-19T15:46:06Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![ben-duchy](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ben-duchy/32/84083_2.png) [@ben-duchy](https://community.hubspot.com/u/ben-duchy)\
**Post date:** [May 19, 2022, 3:55pm UTC](https://community.hubspot.com/t/web-module-linked-to-crm-object/57292/5 "2022-05-19T15:55:39Z")

</div>

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 }}**

---

<div class="post-metadata">

**Author:** ![LMeert](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/lmeert/32/103847_2.png) [@LMeert](https://community.hubspot.com/u/LMeert)\
**Post date:** [May 19, 2022, 4:24pm UTC](https://community.hubspot.com/t/web-module-linked-to-crm-object/57292/6 "2022-05-19T16:24:39Z")

</div>

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](https://d2qpr2jzcazej7.cloudfront.net/original/2X/f/f0f9bf82eb7d703fe178894e325f3b1397692252.png)

If the attendance isn’t showing it’s because you made a typo on “attendance”.

 ![LMeert_1-1652977449085.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/3X/f/6/f6da45c86abbc459a1d43f62896a0f8081c8867e.jpeg)

Simply remove the pprint portion and the \*\*\*\*\*\*\* line, and change “attandance” for “attendance” and you’re all set 🙂

---

<div class="post-metadata">

**Author:** ![ben-duchy](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ben-duchy/32/84083_2.png) [@ben-duchy](https://community.hubspot.com/u/ben-duchy)\
**Post date:** [May 19, 2022, 6:46pm UTC](https://community.hubspot.com/t/web-module-linked-to-crm-object/57292/7 "2022-05-19T18:46:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [May 19, 2022, 7:05pm UTC](https://community.hubspot.com/t/web-module-linked-to-crm-object/57292/8 "2022-05-19T19:05:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ben-duchy](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ben-duchy/32/84083_2.png) [@ben-duchy](https://community.hubspot.com/u/ben-duchy)\
**Post date:** [May 19, 2022, 7:55pm UTC](https://community.hubspot.com/t/web-module-linked-to-crm-object/57292/9 "2022-05-19T19:55:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [May 19, 2022, 7:56pm UTC](https://community.hubspot.com/t/web-module-linked-to-crm-object/57292/10 "2022-05-19T19:56:55Z")

</div>

You and me both, friend.
