I am missing something? (I searched in this forum but found nothing)
The if function needs 3 arguments. So you cannot use: if(test, do this)
You must write: if(test, do this, do that)
If I want to do nothing, it’s easy when dealing with text: just return “” → `if(test, “test ok”, “”)´
But if the result of a test is an entity (say a Contact), what can I return? What is the equivalent of “” for an entity? if(test, a_given_contact, ????)
In that case, you could use the filter().sort().first() functions in such a way as to return a null/empty result.
e.g. Contacts.filter(Name = "").sort().first() will give you zero contacts if all contacts have a name.
In fact, it might be possible in some cases that you could just use this formulation (with an appropriate filter condition) without needing the if condition.