Wrong format when extracting single select from Zapier to google sheet
Hello,
I want to create a new line in google sheet when a new record is created in my Airtable. The problem is that some of the values I want to extract from airtable to google sheet are not in the right format (text). Especially single select fields that are encoded and not in a text format.
How can I do to convert thoses fields in the right format? Apparently I need to use the Utilities in Formatter by Zappier but I don’t really know how to use it. Can somebody help me on that?
Page 1 / 1
Hi @ArthurNoBrainer,
Welcome to the Zapier Community!
You can achieve this using a Lookup Table in the Formatter by Zapier app or with some JavaScript in a Code by Zapier app (this is my preferred method, but also requires some programming knowledge).
For the Lookup Table, you’d do something like the screenshot below, which, in this specific example, would output “Single Select Option 1”. You’d need to perform a separate action for each field you want to look up, which is why I prefer going the code route, which can process all of your fields in one step):
Thanks for sharing this, @Todd Harper!
Do ya think that could work for ya, @ArthurNoBrainer?
Keep us posted - we’d love to know how you’re getting along.
Hi @Todd Harper
Thanks for your kind help! I think I understood what I need to do.
The problem is that I need to convert almost 30 differents records which every of it corresponds to a Uber Eats restaurant category in my “Tags Table”. My “Tags” table will be linked to the “Brands” table and every brand in this table will have 3 different Uber Eats tags (Indian, Halal and street food for example). And I don’t really know what is the lookup key for each tag. Where can I find it?
The second solution proposed will be the best and the more efficient but I don’t know what will be the structure of this code too…
A lookup field allows you to pull record contents from one linked record into another linked record. As a reminder, linked relationships can be either within the same table or across two separate tables.
Also, the problem is that I have a “restaurants” table linked to a “Virtual restaurant” table. Each virtual restaurant will have 3 differents Uber Eats Tags and an assigned restaurant.
But the “restaurants” table is populated with a form. So how can I automatically convert each new restaurant to be readable in my google sheet?
Hi there @ArthurNoBrainer! Troy’s suggestion of using a Lookup field directly in your Airtable base sounds like it could be a good solution here.
Are the readable names for the tags (Indian, Halal etc) stored alongside the corresponding tag ID number (e.g. something like recC1234758663645) in one of the tables? If so, it seems like the Lookup field in Airtable would allow you to pull in the tag name into the table/view that’s sending the records information to the Zap.
If the tag names don’t exist in the Airtable, only the tag IDs then you’d need to set up a lookup table which could be done using Formatter, like Todd mentioned previously. The Lookup Key would be the Airtable field containing the value you’re looking to convert (for example the Airtable field containing the tag’s ID number). I’d recommend checking our Create lookup tables in Zaps guide for more info.
If you have multiple Zaps that would need to access the same lookup table though, you might want to create the lookup table in a separate table in Airtable. That would make it easier to add new tag IDs and names to the lookup table as you’d only need to add them in one place. You would then use a Find Record (Airtable) action in your Zap(s) to search by the ID number and that would output the tag’s name.
Hopefully that helps to explain. Please do let us know how you get on with this!
Hello @SamB
Thanks for your help
In fact the record IDs are stored along the tags (Indian, Halal..) in the “Uber Eats” table. And I already use a lookup.
To explain the situation, when a new record is created in the “virtual restaurants” table, it creates automatically a new line in my google sheet. The “virtual restaurants” table is already linked to the “brands” table and each brand has 3 Uber Eats tags assigned (by the uber eats tags table). So in my “virtual restaurants” table i have a linked table “brands” with 3 Uber Eats tags that I display with a lookup. But when I try to export the right data in my google sheet (including uber eats tags), it appears with the record ID and not the value I want (Indian, halal...)
Do you have a solution for that ?
Ah I see, thanks for clarifying that @ArthurNoBrainer!
In that case, you could try adding a Find Record (Airtable) search action to the Zap to search for the tag (in the Tags table) using the ID from the Airtable trigger. I’m thinking that would allow the Zap to find the tag’s record (in the Tags table), which would have its name. Then you could use the name it found as the value to send to Google Sheets, instead of the tag’s ID from the Airtable trigger.
Want to give that a try and let us know if that works?