When placeholder is empty I want IFstatement to return nothing, what am i doing wrong?

{{if(2.Link naar website = emptystring; emptystring; 2.Link naar website + “?utm_source=linkedin&utm_medium=organic&utm_campaign=feed”)}}

So when there is no link in the placeholder now it returns the text “utm_source etc.” without the link, but I would like it to return nothing when placeholder is empty.

Include screenshots of

Try using this

{{if(2.Link naar website = emptystring; emptystring;‘’ 2.Link naar website + “?utm_source=linkedin&utm_medium=organic&utm_campaign=feed”‘’)}}

after the first condition if link is empty you should put “” around the whole link
‘’ 2.Link naar website + “?utm_source=linkedin&utm_medium=organic&utm_campaign=feed”‘’

1 Like

I suspect that your variable “Link naar website”, is null when empty, and isn’t even an empty string.

What you can do, is ensure the length of the string is greater than zero.

{{ if( length(2.`Link naar website`) > 0; 2.`Link naar website` + "?utm_source=linkedin&utm_medium=organic&utm_campaign=feed"; emptystring) }}

Screenshot_2024-01-24_200119

2 Likes

This works thank you! Is that something you can check or see in Make what the variable exactly is?

I run into this type of stuff more often and wonder is there a way to check control flows or statements like this for bugs.

I tried downloading input bundles but that doesnt show the variable as null, it shows empty

Usually I use length when checking for strings, because it checks whether it exists as well as it is of non-zero length (empty string).

Links

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

General

Help Center Basics

Articles & Videos

3 Likes