Create/modify a list of things from API

Dear all,

I have an API that sends me jobs. The idea is to create or update each job in the database.

For the moment, all the jobs are created in only one line of the database rather than separated.

In back-end workflows, I created “all jobs” that is supposed to receive a list of jobs in the “list-jobs” parameter and then create/update each job (see image 1).

image 1

I can receive all the jobs that look like this :


image 2

The problem occurs when I want to pass the response inside the “list-jobs” parameter which says they are expecting a list of Jobs rather than a text:

image 3

Is there a way to convert the API response to a list of Jobs or should I do everything differently? I couldn’t modify it directly in the image 2.

Thank you for help.

Kind regards

Hi @flo08, you get this error because the schedule function expects a list of things (in this case list of Jobs).

Just to understand, why do you want to have all the jobs in the same entry? Is there any specific case where you need this?

Otherwise, it would be best if you create a new entry in the database for each job. This way, you will have a list of Jobs.

Redu.

Dear @yusaney1 ,

Thank you for your reply.

Sorry for the misunderstanding.
Actually all the jobs are stored in only one entry.

I am trying to create a new entry in the database for each job.

Do you have an idea how to convert the API response to a list of Jobs?

Kind regards,
Flo

It finally worked thanks to this post (see the message from louisadekoya) : Create list of things from API - I'm stuck :(