Hello there, we are working with Farmers, some of whom do already have a unique Grower Number (GN). We are using pulldata() to get the names of those with a GN number. For those who don’t, we have to enter the names manually. So, we have pulldata(‘GN5’,’FN’,’ID’,${GN}) and that works fine. The name for the pulldata variable is FN
The Farmers name with a GN is displayed as a label for the text field Fname.
If there is no GN the user can type in the name which is stored in the variable ${Fname}
What I am trying to do is something like this: if((${GN} !=’’),${Fname} = ${FN},${Fname}))
If there is a GN, then use the data from pulldata (FN) else use the typed in data (Fname).
Unfortuantely this is not working. Any suggestions are welcome.
Thanks
Thomas
That is not the issue. I learned the hard way that the csv is static. My problem is the if statement if(($(gn) =’’), ${fn} =${fname}, ${fn})). The question is if I can manipulate variables with the if clause. Thanks
Yes you can create a new variable through the if function in a question of the calculate type (and then show it as a label in a text question). However in your example your second argument is a logical test evaluating to true or false. Also your brackets seem not right. Can you try something like this
if(${GN} !=’’, ${FN}, ${Fname})
this reads like if ${GN} is empty, take variable ${FN} else take the value of variable ${Fname}