Twig HuBL:如何通过联系人ID检查联系人所属的列表?

Twig HuBL:如何通过联系人ID检查联系人所属的列表?,twig,hubspot,hubl,Twig,Hubspot,Hubl,如果用户是HubSpot中列表的一部分,我将尝试显示特定内容 Psuedo: {% set id_querystring = request.query_dict.id %} {% set registration_list_id = "6136" %} <!-- id of the list I'm checking --> {% if id_querystring in registration_list_id %} contact is part of

如果用户是HubSpot中列表的一部分,我将尝试显示特定内容

Psuedo

{% set id_querystring = request.query_dict.id %}
{% set registration_list_id = "6136" %} <!-- id of the list I'm checking -->

{% if id_querystring in registration_list_id %}
 contact is part of list
{% else %}
 contact is not part of list
{% endif %}
如果联系人id是此列表的一部分,则执行此操作

此时正在从查询字符串中获取联系人ID。我试图检查用户是否是上述列表的一部分,但它不起作用

方法

{% set id_querystring = request.query_dict.id %}
{% set registration_list_id = "6136" %} <!-- id of the list I'm checking -->

{% if id_querystring in registration_list_id %}
 contact is part of list
{% else %}
 contact is not part of list
{% endif %}
{%set id\u querystring=request.query\u dict.id%}
{%set registration\u list_id=“6136”%}
{%if id_querystring in registration_list_id%}
联系人是列表的一部分
{%else%}
联系人不在列表中
{%endif%}
我使用以下代码:

{% set list_variable = request_contact.list_memberships|pprint %}
{% if "id of the list you are checking" in list_variable %} ← without the quotes

yes, you are in the list

{%else%}

No, you are not in the list

{%endif%}
尝试使用on
request.query_dict.id
,这样我们就对变量结构有了概念,并将其发布到您的问题中。