I am a new user to Tulip and need your support to understand more about the link function. I have looked at the Technical Docs and also looked at the University Course but it is still not giving me clarity.
Can you provide some detailed examples on

What does the Link() function do and how to use Link ().

Does the Link () require the arguments to be of the same type?
Thank you for your support.

Hi @Bhaskar, welcome! In my opinion the link() function is poorly named, but pretty straight forward once you understand that itâ€™s not doing anything that youâ€™d expect from the verb â€ślinkâ€ť.

The idea behind the link function is that some functions will not evaluate if one of the its values is null. I can explain it further like this:

Letâ€™s say that we have any expression X + Y = Z. The value of X is 1 and y is null. In several programming languages, Tulip included, the expression 1 + null will not evaluate. Hereâ€™s where the link() function comes in. Link() essentially says, â€śIâ€™m going to take a variable/tablerecord/etc as a value, and Iâ€™ll use that value if itâ€™s not null. If the value is null, Iâ€™m going to take the next argument specified in the function.â€ť So if using our example, we could write X + link(Y, 0) = Z and Z in this case will equal 1. Weâ€™re passing a 0 into the equation where there previously would have been a null value. You can add as many arguments as youâ€™d like after the initial value, including other variables/table records. All arguments must be of the same type. If youâ€™re familiar with coalesce() in SQL, it performs the same function.

Is there a limit on the number of arguments that Link () function can accept? I hope not!

Thank you for taking the time to respond to my question, it is much appreciated. Your answer helps. Thanks a lot. I hope there is no limit to the number of questions, as I have many and would post more questions.