Jul 13, 2020 11:00 AM
I have three tables - Organizers, Events and Players. Organizers have events and players are part of an event. I want to pull the most recent event for a particular organizer through the API via a GET, but can’t figure out how to do that.
I’d also like to pull in a particular event by ID. In this case, I’ve pulled the ID of the event into a column (RecordID) via a formula (RECORD_ID()), but don’t know the correct URL parameter to send.
Thanks in advance.
Solved! Go to Solution.
Jul 17, 2020 09:17 AM
Hi @Steve_Manatt,
Thanks for your question, and welcome to the community! :grinning: Happy to help with this.
This can be done with a GET, using a combination of a few different parameters. Head to the “List records” section of your API docs for details on each param. For this example, I’m assuming that records in the “Events” table have a linked record field for “Organizer”.
AND({Organizer} = 'Jane Doe', {Date}<NOW())
to get records with a particular Organizer and a date that is in the past.[{field: "Date", direction: "desc"}]
to sort results by date, in descending order.maxRecords=1
, to return only the first record (which should be the most recent event for that organizer).You should be able to do this with a “Retrieve a record” call, specifying the ID of the record you’d like to retrieve. More info can be found in the “Retrieve a record” section of your table’s API docs.
The suggestions above may not work perfectly for you, depending on how your tables and fields are set up. But I hope this is enough to set you on the right track!
Jul 17, 2020 09:17 AM
Hi @Steve_Manatt,
Thanks for your question, and welcome to the community! :grinning: Happy to help with this.
This can be done with a GET, using a combination of a few different parameters. Head to the “List records” section of your API docs for details on each param. For this example, I’m assuming that records in the “Events” table have a linked record field for “Organizer”.
AND({Organizer} = 'Jane Doe', {Date}<NOW())
to get records with a particular Organizer and a date that is in the past.[{field: "Date", direction: "desc"}]
to sort results by date, in descending order.maxRecords=1
, to return only the first record (which should be the most recent event for that organizer).You should be able to do this with a “Retrieve a record” call, specifying the ID of the record you’d like to retrieve. More info can be found in the “Retrieve a record” section of your table’s API docs.
The suggestions above may not work perfectly for you, depending on how your tables and fields are set up. But I hope this is enough to set you on the right track!