XForm is invalid. See above for the errors.
org.javarosa.xform.parse.XFormParseException: invaide calculate for the bind attached to "${s_2}": Bad node: org.javarosa.xpath.parser.ast.ASTNodeAbstractExpr@567d299b in expression....
Error only happens when I move "pulldata" out of "if" statement and call on the "pulldata" from referenced field. If i put "pulldata" in "if" statement, there is no issue with validation, however this does not meet my needs.
2. What app or server are you using and on what device and operating system? Include version numbers.
XLSform, win10
3. What you have you tried to fix the problem?
-nesting the if statements, but it doesn't accomplish what I need.
-moving the pulldata rows above the if calculations
-creating a new row for each "if" (this works, but seems untidy and silly)
-changing the "type" to "hidden" and "decimal" rather than "calculate"
-putting many things in and out of parenthesis
4. What steps can we take to reproduce the problem?
set up a calculate type field by referencing another calculate rather than typing out the "pulldata" in the "if" statement
5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.
The syntax of your if(...) statement is incorrect. Instead of:
if($practice}="Conservation Cover (317)(acres)", ${s_gps},0) if(${practice}="Critical Area Planting (342)(acres)", ${s_gps}, 0)
you should probably have:
if($practice}="Conservation Cover (317)(acres)", ${s_gps}, if(${practice}="Critical Area Planting (342)(acres)", ${s_gps}, 0))
Specifically, the second if(...) statement needs to constitute the false component of the firstif(...) statement. That's how to implement an "if (a) then foo else if (b) then bar else baz", which I presume is your intention...