You can access the element by its index, starting from 1.
fromDate[1]
// "21-Apr-2021"
fromDate[2]
// "22-Apr-2021"
You don’t need to but you could use input mappings on the service task. The mappings are applied before the job is created from the job worker. They create a new local variable in the scope of the task. Read more about it here: Variables | Camunda 8 Docs