APIs & Integrations

CD81
Participant

Using IF Statement in datasets

SOLVE

Hi, This is not strictly related to API/integration but support suggested posting under developers...

i'm hoping to use an IF statement in a dataset formula to identify when particular multi-select properties were chosen.

 

I'm getting a syntax error referring me the support documentation, but i cant find any info relating to multi-select fields - my query is essentially If ([event] = BIOMUK 2022, 'true', 'false') In this case BIOMUK 2022 is a selectable option within the multi-select 'event' field. I've tried '=', is, LIKE and other operators but no luck. Am i missing something obvious/is there a way to phrase the formula that would work?

0 Upvotes
1 Accepted solution
CD81
Solution
Participant

Using IF Statement in datasets

SOLVE

Thanks for the suggestion. I was trying to have the formula work at the report-datasets level and i'm not sure that yet supports the syntax above, I think i'll have to work on external report for now.

View solution in original post

0 Upvotes
3 Replies 3
Ryamak
Participant

Using IF Statement in datasets

SOLVE

Hello,

You might need to add CONTAINS to the formula? I was having the same issue with a multi-checkbox field and a HS Product rep sent me this formula to use.

IF(CONTAINS([DEAL.multi_attribution_lead_department], "Marketing") = true, 1, 0)

Hope this helps!

0 Upvotes
hipya
Member

Using IF Statement in datasets

SOLVE

Hi, I don't know if this is what you are looking for but maybe it is.

I a single line:

 

{{ "BIOMUK 2022" if ("BIOMUK 2022" in module.events) is truthy else "No BIOMUK 2022" }} 

 

 

Or with a normal if/else statement:

 

{% if "BIOMUK 2022" in module.events %}
  BIOMUK 2022
{% else %}
  No BIOMUK 2022
{% endif %}

 

0 Upvotes
CD81
Solution
Participant

Using IF Statement in datasets

SOLVE

Thanks for the suggestion. I was trying to have the formula work at the report-datasets level and i'm not sure that yet supports the syntax above, I think i'll have to work on external report for now.

0 Upvotes