Best answer

Find largest value within a field in Airtable

  • 5 May 2023
  • 5 replies
  • 222 views

Userlevel 1

Halloo! I need to search for the biggest number among the values in a field in Airtable.

For example, in Table A, there’s a field called “Quantity,” and Table A contains three records, with values 2, 6, and 4, my query would return 6.

The Airtable action Find Record with something like “MAX({fieldname})” in the search formula seems like the ticket, but I don’t know the correct syntax. I would love more documentation about how to use <TriggerValue>. 

What else I’ve found so far is this reference to Webhooks by Zapier, but I prefer not to upgrade to Premium at the moment. And the “Learn More” link on the Zapier action is to this suggestion about Multi-Step Zaps, but that article is about a lot of needs other than mine. Maybe looping…?

Thanks for thinking about this!

icon

Best answer by SamB 5 May 2023, 11:11

View original

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

5 replies

Userlevel 7
Badge +11

Hi @BaseFace, welcome to the Community! 👋

Ah, as it’s a search formula the Zap is expecting here, that may be why “MAX(values)” isn’t working.

Rather than using a webhook, you could create a separate Table in Airtable with a single record. Then add a Rollup field to link that record to the ones you want to summarize and use MAX(VALUES) as the formula for it. Then you can use the Zap to search for that table’s record so that it always finds the highest quantity.

If you’ve not worked with Airtable’s Rollup fields before you can find out more about them here: Rollup field overview

I couldn’t find any more documentation on using Airtable’s search formulas than this Advanced tips and tricks one, which you may have already come across? But in order to use <TriggerValue>, you’d need to wrap it around field that’s been selected.

For example:
c61d80a83196f72c63ec068365dd5852.png

Hope that helps to point you in the right direction, keen to know how you get on here!

Userlevel 1

Thank you, @SamB! I had tried the rollup field, but I wasn’t sure how in Airtable to automatically include every record from the other table. I will post that question in the Airtable community, but if anyone here knows, I’d be grateful for the further pointer!

Userlevel 7
Badge +11

You’re welcome, @BaseFace

You could potentially use Airtable’s built in Automations to automatically link the records. They’ve got a guide on how to do that here: Linking existing records using automations
 
Please do keep us in the loop on how that goes! 🙂

Userlevel 1

Ah that’s superpower @SamB! That did the trick, and I never would have thought it would require that kind of workaround. Thanks a ton!

Userlevel 7
Badge +11

YAY! That’s fantastic news @BaseFace. I’m so pleased you were able to get it sorted! 😁🎉

Happy Zapping! ⚡