Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

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 ...
  • LivioLanzo's avatar
    7 years ago

    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?