Forum Discussion
Anonymous
7 years agoNot applicable
if statement and early exit in m function
OK, so say I make a simple function (in the advanced editor): (test1 as text)=>
let
if test1 = "yes" then Source = "OK" else Source = "Dang"
in
Source This has an error of Token Identifier ...
- 7 years ago
Hi Anonymous -
the right synthax is:
(test1 as text)=> let Source = if test1 = "yes" then "OK" else "Dang" in Sourcefor the other question, it depends on what else have in your query, is the function the only code?
LivioLanzo
7 years agoSolution Sage
Hi Anonymous -
the right synthax is:
(test1 as text)=>
let
Source = if test1 = "yes" then "OK" else "Dang"
in
Source
for the other question, it depends on what else have in your query, is the function the only code?
Anonymous
7 years agoNot applicable
LivioLanzo wrote:it depends on what else have in your query, is the function the only code?
This function would be called from another function. However, it is only this function I want to exit, and just return an error string. The parent function should continue to process and will just display the error.