Custom function using another custom function

This is so basic I can’t believe I can’t find docs/examples.

isShowable()
ifelse({response_set_group_cnt} < 3, false, true)

label_text()
ifelse({isShowable} = TRUE, {label}, “too few”) <some syntax error - poor info BTW>

I saw some thread about (isShowable={isShowable}, …) That compiles but doesn’t work. It always evaluate true. The example actually doesn’t compile it used ${isShowable}

How can I express myfunc() == xyz?
Where did I miss in QS docs how to do this?

Bonus points if you can pass args…

isShowable(text)
ifelse({response_set_group_cnt} < 3, “too few”, text)

Then my display text calculated fields are just
label_text()
isShowable({label_text})

Hi @sirwin007 ,

I understand you are looking to create a new field with a custom text or column value {label} when {response_set_group_cnt} is greater than or = 3 or show ‘too few’ when {response_set_group_cnt} is less than 3. Please correct me if I am wrong.

Is the custom text or arg that you are looking to pass obtained from end users? using a parameter control that you created?

If so, can you try: ifelse({response_set_group_cnt} < 3, ‘too few’, ${parameter_name})

If you are looking to show the value from {label} field, try: ifelse({response_set_group_cnt} < 3, ‘too few’, {label})


You can use a calculated field within another calculated field. Please test the modified syntax below and check if it works at your end.

isShowable()
ifelse({response_set_group_cnt} < 3, ‘false’, ‘true’)

label_text()
ifelse({isShowable} = ‘true’, {label}, “too few”)

1 Like

Having the function return a string vs a boolean worked. Thank you - however that magical incantation should be documented somewhere.

Support for classic function parameters would be feature request since you don’t support it. This makes our code much more manageable. I have 10 functions that need to call isShowable() and I have to duplicate code 10 times. If I could pass an argument such as the text to return the main logic is in isShowable and the 10 functions just call isShowable(myTextField). If I need to change “too few” (example) to something else - 1 change and done vs find the 10 functions.

Thanks for you help