how to loop a!completeTask function and save the result

how to loop a!completeTask function and save the result

 

i have list of task ids and list of  task inputs,on click of a button it should be able to complete tasks using a!completeTask function in a loop,but am unable to do it in a loop.Can anyone help on this? 

 a!buttonWidget(
label: "complete task",
saveInto: {
/* how to write the below function in loop and how to save it using a!save function*/
a!completeTask(
taskId: tointeger(ri!selectedTaskIDs ),
taskInputs: { input: ri!taskInput },
onSuccess: a!save(ri!message, "Updated Successfully"),
onError: a!save(ri!message, "Already Updated")
)
},
style: "PRIMARY"
)

 

 

Thanks in advance

Parents
  • Can you elaborate more on the exact problem you're facing when you're trying the loop? (Maybe with code snippets?) I'm guessing your problem is that you're not associating the task ids and task inputs properly in that one task id needs to correspond to multiple task inputs, so you may need an array of arrays for your task input to loop properly. A sample snippet would help us be able to provide a more detailed solution.
Reply
  • Can you elaborate more on the exact problem you're facing when you're trying the loop? (Maybe with code snippets?) I'm guessing your problem is that you're not associating the task ids and task inputs properly in that one task id needs to correspond to multiple task inputs, so you may need an array of arrays for your task input to loop properly. A sample snippet would help us be able to provide a more detailed solution.
Children

 Discussion posts and replies are publicly visible