APIs & Integrations

rainism
Miembro

Import fields' values

resolver

Hello.
I would like to know if there is any way to import values into the fields that I use in custom modules for my landing page

0 Me gusta
1 Soluciones aceptada
IsaacTakushi
Solución
HubSpot Employee
HubSpot Employee

Import fields' values

resolver

Hi, @rainism.

 

Unlike contact properties, it is not possible to reference product property values on a web page with HubL variables.

 

If a website visitor's identity is associated with a known contact record, HubL can retrieve the corresponding property values. Products, however, cannot be associated with visitor identities or contact records (only deals via line items), and cannot be referenced on their own.

 

You could store product information in custom contact properties and use HubL variables to surface this data, but every visitor identity would need to be associated with a contact with a known value in order to see it. At that point, hard coding may be a better option.

 

Finally, I want to mention HubDB again, which is by far the best tool if you wish to curate a listing of products in one place and have the data populate across your website. Check out the technical documentation here.

Isaac Takushi

Associate Certification Manager

Ver la solución en mensaje original publicado

0 Me gusta
6 Respuestas 6
IsaacTakushi
HubSpot Employee
HubSpot Employee

Import fields' values

resolver

Welcome, @rainism.

 

Happy to help.

 

Could you clarify the type of "field" you are using?

 

If you are storing values in custom contact properties and using HubL "personalization" tokens to render their values in your custom modules (e.g. {{ contact.firstname }}), you can absolutely set and update values via import.

Isaac Takushi

Associate Certification Manager
rainism
Miembro

Import fields' values

resolver

I'm mostly using image and text fields, and I guess I can't really create an image field via Properties.

I think I could use fields for Product but I have a question.

I'm gonna use my custom module in another pages as well, so I guess if I change values of the fields via import, it will update the values for all the pages. Is there any workaround?

I'd probably make another custom module but there gonna be a lot of pages so I don't want to update the values manually.

0 Me gusta
rainism
Miembro

Import fields' values

resolver

No, just realized there's no image field for Product

0 Me gusta
IsaacTakushi
HubSpot Employee
HubSpot Employee

Import fields' values

resolver

Hi, @rainism.

 

While there are no "image" fields, most users upload an image link to a single-line text field and then place the token in an img tag's src attribute. For example:

 

 

<img src="{{ contact.image_1 }}" alt="Image 1" height="50" width="50"> 

The above approach only works with custom contact properties, however. It will not work for custom product properties.

 

If you need to display product images and descriptions, you might want to consider HubDB (keep in mind this requires the HubSpot CMS.) Check out the technical documentation here.

 

Isaac Takushi

Associate Certification Manager
0 Me gusta
rainism
Miembro

Import fields' values

resolver

Is it possible to show products' fields in the custom module? Like {{product.field1}}?

0 Me gusta
IsaacTakushi
Solución
HubSpot Employee
HubSpot Employee

Import fields' values

resolver

Hi, @rainism.

 

Unlike contact properties, it is not possible to reference product property values on a web page with HubL variables.

 

If a website visitor's identity is associated with a known contact record, HubL can retrieve the corresponding property values. Products, however, cannot be associated with visitor identities or contact records (only deals via line items), and cannot be referenced on their own.

 

You could store product information in custom contact properties and use HubL variables to surface this data, but every visitor identity would need to be associated with a contact with a known value in order to see it. At that point, hard coding may be a better option.

 

Finally, I want to mention HubDB again, which is by far the best tool if you wish to curate a listing of products in one place and have the data populate across your website. Check out the technical documentation here.

Isaac Takushi

Associate Certification Manager
0 Me gusta