Question

Search for column header name (not column number) in trigger data

  • 9 July 2021
  • 8 replies
  • 296 views

Hi,

I’ve been using Zapier for a while but I need to do something that experience tells me will be a little tricky.

Is there a way to force an action step to use the data from a column (preceding step likely to be Import CSV file), based on the **column header name**, and not on the column number / position within the file.

I need to automate a process which starts with very similar but not identical outputs - ie predictable column names, but sometimes an extra column or two where additional data is present, which throws out the position.

The goal of this is to homogenise all the outputs into a totally uniform set of columns, so that I can use “Insert Row” in the destination app.

Any ideas? Is there a search or find column utility somewhere?


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

8 replies

Userlevel 7
Badge +14

Hi @neili 

Perhaps consider having separate Zaps or using Paths if there are variable headers and order of headers in a CSV file.

https://zapier.com/apps/paths/integrations

Hi @Troy Tessalone ,

 

Yes, a decent suggestion, and I have used paths before, but for this particular challenge there are too many possible variations.

What I ideally need is something like you find in SQL queries, where you look for the column by name, and its location doesn’t matter.

Userlevel 7
Badge +14

@neili 

If you’re deal with CSV files, then you might have to explore using a custom Code step to dynamically parse and prep the CSV file data before trying to use it in future Zap steps.

@Troy Tessalone sounds logical. Its a very simple query in sql:

select column_1, column_2, column_etc from csv_import

However, it looks like the custom code only supports Javascript and Python, neither of which I know.

Userlevel 7
Badge +14

@neili 

Are you able to import this CSV file into a database app that has a Zap integration such that you can do a SQL query?

@Troy Tessalone well, getting them into such a system is the object of this exercise.

 

Currently I have to do this manually, and this is the step I’m trying to remove. It might be my software version, or my ignorance, but I can’t see a way of automatically importing a file as a table.

 

Zapier actions for the DB in question are New Row or Update Row, hence the need to homogenise.

Userlevel 7
Badge +14

@neili 

Code step is likely the way to go: https://zapier.com/apps/code/help

If you need help you can look into hiring a Zapier Expert: https://experts.zapier.com/

Alright, thanks @Troy Tessalone . There’s a couple of people I’ve worked with who know Python and JS respectively.