APIs & Integrations

rainism
Membre

Import fields' values

Résolue

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 Votes
1 Solution acceptée
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Import fields' values

Résolue

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

Voir la solution dans l'envoi d'origine

0 Votes
6 Réponses
IsaacTakushi
HubSpot Employee
HubSpot Employee

Import fields' values

Résolue

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
Membre

Import fields' values

Résolue

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 Votes
rainism
Membre

Import fields' values

Résolue

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

0 Votes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Import fields' values

Résolue

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 Votes
rainism
Membre

Import fields' values

Résolue

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

0 Votes
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Import fields' values

Résolue

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 Votes