I use these type of dropdowns frequently with document variables but never have tried it with an obs, here is my if then. I must be missing something minor any ideas?
{if str(OBSNOW("Chem Drug 1")) == "test1" then
"1,2,3"
else if str(OBSNOW("Chem Drug 1")) == "test2" then
"3,2,1"
else "none"
endif endif}
In case any wonders this seems to work fine:
{if OBSNOW("CHEM DRUG 1") == "test1" then "1,1,1"
else if OBSNOW("CHEM DRUG 1") == "test2" then "2,2,2"
else ""
endif endif}
My two suggestions are:
1). The original question has some strange looking quotation marks on the parts that require quotes, while your response with the test code has uniform quotation marks. I tried using the code you had posted and it couldn't recognize the quotes on the right side of each string. here is my result:
{if (OBSNOW(“weight?)) == “200? then
“1,2,3?
else if (OBSNOW(“weight?)) == “100? then
“3,2,1?
else “none”
endif endif <-COMPILER ERROR NEARBY: Expect EXPRESSION. Instead had NON-TERMINATED STRING after LEFT PAREN
The question marks indicate that the end-quote is not recognized.
2). You do not need to use str() on the obs term. Obs terms are already strings, and it might be causing problems to tell it to convert a string to a string.