I want the answerScore and answerComment fields to be left null if the $_POST.response[$index] field != 'answered'. If is does == 'answered' then store those values. Hope I’ve explained that correctly. The screenshot illustrates how I think it should work… but it doesn’t!
Yes. And with those conditions in place the answerScore and answerComment fields are staying null even if the answerAnswer field successfully stores ‘answered’. This is why I’m wondering if it’s a bug. I’m sure my setup is correct for what I want to achieve.
It looks ok. One thing you could try is a setValue step before the query (inside the repeat) and set it to the $_POST.response[$index] value. You could then use that (as well as output it to check what value it is getting) as the condition/insert value in the query
Ignore the first four columns but the remaining two behave fine for the first four records and then just stick to null after that. Rows 3 and 4 should be null but 5 onwards should go back to storing values.
{"identity":1,"repeatResponse":[{"answered":1,"scale":"7","comments":"Comment for q1"},{"answered":1,"scale":"3","comments":"Comment for q2"},{"answered":0,"scale":"5","comments":""},{"answered":1,"scale":"4","comments":"Comment for q4"},{"answered":0,"scale":"5","comments":""},{"answered":1,"scale":"5","comments":"Comment for q6"},{"answered":1,"scale":"5","comments":""},{"answered":1,"scale":"5","comments":""},{"answered":1,"scale":"5","comments":""}]}
All as I would expect. The last three I just left the comments box empty.