Sep 14, 20213:43 AM - edited Sep 14, 20213:45 AM
Top Contributor | Platinum Partner
Access value in request.cookies object array
SOLVE
Hello @DevM , since {{user_info}} returns a json string, you can convert that to a hubl object with the fromjson so you can access its keys like you tried to. So the snippet would look something like this:
{% set user_info_json = user_info %}
{% set user_info_obj = user_info_json|fromjson %}<br>
{{user_info_obj.crm_id}}
Sep 14, 20213:43 AM - edited Sep 14, 20213:45 AM
Top Contributor | Platinum Partner
Access value in request.cookies object array
SOLVE
Hello @DevM , since {{user_info}} returns a json string, you can convert that to a hubl object with the fromjson so you can access its keys like you tried to. So the snippet would look something like this:
{% set user_info_json = user_info %}
{% set user_info_obj = user_info_json|fromjson %}<br>
{{user_info_obj.crm_id}}
Why are you wrapping the request.cookies in an array? ([request.cookies.officerInfo]) Does it not work if you use {% set user_info = request.cookies.officerInfo %} ?
Could you use the |pprint filter to check the output of user_info? {{user_info|pprint}}
Learn more about HubSpot by following me on LinkedIn or YouTube
✅ Did my answer solve your issue? Help the community by marking it as the solution.