Airtable shortcuts - GET


#1

Hi all

I’m struggling to retrieve airtable entries using Shortcuts.

Can retrieve the first record in the format of a dictionary. But not all records for a specific field.

Any help is sooo welcome!!


#2

Can you post an example of what you have so far?


#3

Thanks!!


#4

See if this helps any.

Here’s an example table “Fruit” in my “Fruits” AirTable workspace. It has two columns - “Type” and “Colour”.

I’ve blurred out some of the specific access details (e.g. API key), but here’s what my example workflow looks like to access it and pull back all of the rows (well I limited it to 9,999) from the table. It retrieves the data, grabs the records, then for each record grabs the fields. I then use the fields to build up a list - just an example showing how output can be built.

Hope that points you in the right direction.


#5

Are you sure the 2 Get Dictionary Value steps are needed? You may want to try without the first Get All Values action.


#6

It helped a lot. I’m now able to retrieve the data AND understand the logic!! Thanks!!!


#7

I don’t…it was part of my experiments :wink:


#8

Hi!!

Is there a way to compare 2 dates? This way is failing, must be doing wrong :grinning: thanks!!!


#9

I would suggest that next time you post this sort of thing as a different question as it isn’t something directly related to AirTable and Shortcuts. It’ll then help people find it in searches. Also do remember to post details of inputs for any examples. Data can be as much an issue as an algorithm.

Here’s an approach for the date query that should work:

It takes a date from input, calculates the difference in days between it and the current date/time. If that is zero, the date parts are the same. If it is non-zero, they are different.

At the end of the day, dates are just numbers. They represent a counter that counts forward (or backward) from an agreed point in time. Think about how you would compare numbers and you shouldn’t go too far wrong.

Hope that helps.


#10

Thanks it does help!!

Kept the question here as it followed up from my previous one, but you’re right not the easiest for someone else to find.


#11

I’m not completely following - these dictionaries are still mysterious to me. I have my shortcut set up the same way as your example, but I don’t understand how you’re able to specify that you want to get the dictionary values for ‘type’ and ‘color’. How/where do you tell Shortcuts to fetch these? When I add the ‘dictionary value’ bit to the text field, and subsequently tap it to specify what it is that I want, I can pick file size, extension etc, but I can’t set any custom thing. What am I missing?
Update: Ah, you have to tap ‘type’ and pick ‘dictionary’ and then you get an option to enter the thing you want the value for!


#12

Exactly :sunglasses:

Shortcuts doesn’t know innately what you are working with necessarily, so specifying the type of data you are working with can be necessary. When you do, as you saw, the options/parameters change accordingly.