${question.data['phrase']} not working for input data

In my bot task on Control Tower, ${question.data[‘phrase’]} does not pull in the data I load on the data file. See the images below:

org.webharvest.exception.ScriptException: Config line 12: template block groovy.lang.MissingPropertyException: No such property: question for class: Script1_genScript_340 at org.webharvest.runtime.scripting.GroovyScriptEngine.eval(GroovyScriptEngine.java:138) at org.webharvest.runtime.templaters.BaseTemplater.execute(BaseTemplater.java:75) at org.webharvest.runtime.processors.TemplateProcessor.execute(TemplateProcessor.java:69) at org.webharvest.runtime.processors.BaseProcessor.run(BaseProcessor.java:127) at org.webharvest.runtime.processors.BodyProcessor.execute(BodyProcessor.java:27) at org.webharvest.runtime.processors.VarDefProcessor.execute(VarDefProcessor.java:59) at com.freedomoss.crowdcontrol.webharvest.processors.VarDefProcessorValidated.execute(VarDefProcessorValidated.java:28) at org.webharvest.runtime.processors.BaseProcessor.run(BaseProcessor.java:127) at org.webharvest.runtime.Scraper.execute(Scraper.java:169) at org.webharvest.runtime.Scraper.execute(Scraper.java:182) at com.freedomoss.crowdcontrol.webharvest.executor.LocalWebharvestTaskExecutor.executeWebHarvestTask(LocalWebharvestTaskExecutor.java:148) at com.freedomoss.crowdcontrol.webharvest.executor.LocalWebharvestTaskExecutor.executeWebHarvestTask(LocalWebharvestTaskExecutor.java:98) at com.workfusion.service.machine.BotRecordExecutionService.process(BotRecordExecutionService.java:169) at com.workfusion.service.machine.BotRecordExecutionService.process(BotRecordExecutionService.java:140) at com.workfusion.service.machine.BotRecordExecutionService.lambda$processSubmissionWithAllocationLogger$3(BotRecordExecutionService.java:111) at com.workfusion.utils.thread.ThreadMonitoringUtils.executeWithAllocatedMemoryCallback(ThreadMonitoringUtils.java:17) at com.workfusion.service.machine.BotRecordExecutionService.processSubmissionWithAllocationLogger(BotRecordExecutionService.java:111) at com.workfusion.service.machine.BotRecordExecutionService.lambda$processRecord$0(BotRecordExecutionService.java:95) at com.workfusion.utils.thread.NamedThreadTemplate.executeWithNamedThread(NamedThreadTemplate.java:10) at com.workfusion.service.machine.BotRecordExecutionService.processRecord(BotRecordExecutionService.java:95) at com.workfusion.service.machine.thread.RecordProcessThread.run(RecordProcessThread.java:28) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: groovy.lang.MissingPropertyException: No such property: question for class: Script1_genScript_340 at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53) at org.codehaus.groovy.vmplugin.v7.IndyGuardsFiltersAndSignatures.unwrap(IndyGuardsFiltersAndSignatures.java:177) at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232) at Script1_genScript_340.run(Script1_genScript_340.groovy:12) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:585) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:623) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:594) at org.webharvest.runtime.scripting.GroovyScriptEngine.eval(GroovyScriptEngine.java:136) ... 23 more
10.25.2018 22:28:24 ERROR 242660 Step name ‘Test Bot’ has failed. Reason: ’ Config line 12: template block

@david.goodfellow are you using the data in a bot task?

In this case you need to use just the name of the column - phrase.
${question.data[‘phrase’]} is the format used only in Manual tasks.

If you created your bot task in recorder, you need to have a recorder variable with the name “phrase”, and it will be automatically filled with with the input data you provide.

I hope it helps.
Let me know if you still have questions.

1 Like