please correct this for me
If(${stockOnHand} = 0, ${dispensingSiteStock} = 0, then “Stockout” else “Stocked”)
Thanks
wroos
June 28, 2023, 1:10pm
2
Would you mind to have a look at the correct syntax for if expressions, please: ODK XForms Specification
There is no “then” or “else” as textual element.
1 Like
@wroos can you please write out how it should be for me?
Sorry, I’m completely new to this
@kingsaks , we have a list of community discussions on the same topic here . Maybe you could leverage from the workarounds shared/discussed previously.
Maybe you could have a closer look at this post discussed previously (to have a quick understanding of how the if-statement
is used):
You could use the if() statement when you have to assign a certain value/expression for a certain condition else use another value/expression. Thus, the if statements require three arguments: a condition; the result if the condition is true; and the result if the condition is false.
The syntax would be as follows:
if(condtion,value,value)
if(condtion,expression,expression)
if(condtion,value,expression)
if(condtion,expression,value)
You could learn more about the if-statement by following o…