Mutation to create multiple records in a database table from a xlsx spreadsheet.

In the tab recordsImporter (bellow) you can see an example mutation. Once you change the query to your variables, send it to api.pipefy.com/graphql and records will be created with the information of your spreadsheet.

In the tab Structure you can have a better view of the query and you can use this format in our IDE: pipefy.com/graphiql

{
	"query": "mutation { recordsImporter(input: {tableId: \"p0A_JWST\", url: \"https://docs.google.com/spreadsheets/d/13sohSO0eGjgZYqQSFyp0LUFwZhktiU9t3BX6Sgnb_yk/export?format=xlsx\", statusColumn: \"d\", fieldValuesColumns: [{column: \"e\", fieldId: \"company_name\"}, {column: \"f\", fieldId: \"contact_email\"}]}) { recordsImportation { id } } }"
}
mutation { 
  recordsImporter(input: {
    tableId: "p0A_JWST", 
    url: "https://docs.google.com/spreadsheets/d/13sohSO0eGjgZYqQSFyp0LUFwZhktiU9t3BX6Sgnb_yk/export?format=xlsx",
    statusColumn: "d",
    fieldValuesColumns: [
      {column: "e", fieldId: "company_name"},
      {column: "f", fieldId: "contact_email"}
    ]}) 
  { 
    recordsImportation { 
      id 
    } 
  } 
}
tableId (required)Represents the table ID.You can find the table ID in the URL of the table.
url (required)Represents the spreadsheet URL.Sheet file must be public.
statusColumn (optional)Represents column's letter or number where the status phase is represented.In the sheet, the cell should contain the status of the record.
fieldValuesColumns (optional)Represents column's letter or number where the field's value are represented and the field ID where it should be sent to.To get the fields IDs of a table, you can use this query:

{ "query": "query { table(id: your_table_id) { table_fields { id } } }" }

📘

URL

If you are using google spreadsheet, change the end of the URL from /edit#gid=1144534632 to /export?format=xlsx

Response

After sending the query to Pipefy, you will receive a response in your email when the importation process is done!

SuccessIn case of success, an email will be sent to let you know the pipe and how many records were created.
Partially ImportedIn this case, not all records were created. In the email, will be attached a file with the inconsistent lines and the details about the errors (in the last column). Update the lines and use this file to send another mutation to create the remaining records.
Error 1Selected fields couldn’t be found. Maybe you type the wrong column position or field ID.
Error 2File format was invalid. Spreadsheet is not Public or the file is not .xlsx format.
Error 3File format was invalid. Spreadsheet is not Public, the file is not .xlsx format or the cell input was not in the demanded format (in this documentation you can find how you should
configure the information of each column regarding the field type.)