Input
Input task is triggered manually by the user. Before it runs, it will ask you to upload a file. Later this file is available in code editor. This means you can easily access rows of your file and perform certain operations.
Looping over file rows is simple:
Above snippet is going log each row value for column named Your Column Name
.
Code editor is going to have file
object preloaded. This object is an array with JSON objects. Each JSON object has properties named exactly as columns in your source file.
Next, in lines 1-13 we capture GraphQL mutation for creating a customer.
Lines 15-21 define variables required for GraphQL mutation.
Next we use for
loop to go through the file rows and for each row assign email to variables.input.email
.
Having mutation input ready we execute GraphQL query and create our customer.
Last updated