I'm still relatively new to hubspot and am working my way through implementing an existing site onto the platform.
I need to create a relatively complex dictionary of data, that'll be updated further into the page template. So, i'm working through some simple examples to make sure I know hubl can do what I need.
{% set dict_var = {'name': 'Item Name', 'price': '$20', 'size':'XL'} %}
{% set dict_var['location'] = 'fancy location' %}
The above is one example of what I'd like to do. I.e., create a dict - and then update it on the next line. However - this simply won't work. If I print this variable on to the page (further down) it only shows the data without the location key.
I've tried various other ways of attempting to adjust the dict to no avail. Help?
Hi @Cadriel ,normally for every solution we check out on youtube ,however I like the articles related with it ,as i can have the codes clearly mentioned in the posts and find out what went wrong and my internet data will be saved
recently i came across this python dictionary methods where they have shown us different methods .you can refer this for the solution.
Hi @cadriel, it doesn't look like this method is documented on our end, but since HubL is based loosely off of jinja2 which is a subset of python (more info on dicts in python here: https://www.digitalocean.com/community/tutorials/understanding-dictionaries-in-python-3), you can use the update method on the dictionary. The way I updated this dictionary is via the following code:
{% set dict_var = {'name': 'Item Name', 'price': '$20', 'size':'XL'} %}
{% set test = dict_var.update({'7': 'seven'}) %}
{% set test = dict_var.update({'8': 'eight'}) %}
{{ dict_var }}
Printing dict_var on that last line above ends up including both the 7 and 8 properties, and the whole dictionary is printed out. Here's an example --> http://blog.playtimepottery.net/macros
Automation- Process of making tasks happen without human intervention. The reality is "Robot" in RPA is not aphysical entity. It is a virtual system that helps in the automation of manual tiring tasks. RPA or Robotic Process Automation is a technology that allows engineers to accomplish tasks that once required human guidance.
The principal objective of the Robotics Process Automation process to supplant dreary and exhausting administrative errands performed by people, with a virtual workforce.
Hey mate! SR is at your service. You seem to be doing good so far. Let's now learn categories of RPA technology.
RPA technologies can be divided into three categories.
Probiotics
Knowbots
Chatbots
Probiotics
These are the bots that follow simple, repeatable rules to process data.
Are there other generic docs around I could refer to in cases like this? I did refer to some python docs before creating this post but it didn't mention the update method. Perhaps the Jinja docs? Any specific versions?