Get Record

Get Record retrieves a record from a database table by looking up a field. By default the Get Record function is set up to find a record based in the ID field but you can change this to any field you require.

The Get Record is a shortcut function from the Query All Records function that should be used when you are looking for a single record and know which field you want to find that record by.

Inputs - How to Get a Record:

  • Field name: This is the name of the field (column) in your database table that you want to find the record by. Field name will be defaulted to the ID field but you can open the dropdown selector to choose from the list of different fields in the database table.

  • Field value: This how you find the record based on the value of the field name. The field value is typically an input but can also come from things like a variable or the authenticated user ID.

Notice in the photo above: if you choose a field_value that maps to multiple records, then the first one found will be used.

Open the dropdown selector to choose from the other fields in the table if you wish to get a record by a different field name:

If you need to apply a special type of sorting, or find a record based on multiple fields then you should use the Query All Records function.

Output - The response:

The output tab of the Get Record function is similar to the Query All Records function but simplified. You can:

  • Customize - Customize the response, meaning optionally pick and choose which fields you want included in the response. Use this if you only access to certain fields for your API and want to get rid of the unnecessary fields. (Fields have to be included in the response for you to access them elsewhere in your function stack).

  • Addon - Use an Addon to extend the response from related database tables. Addons are covered in detail later in this section.

  • Variable - Choose the name for the return variable which will store the data created from the function.

Settings:

Settings allow you to add a description or comments about what your function is doing. This will be displayed on the function stack to help you see clearly what each step is performing.

Lock

Database lock is an optional setting used to lock the get record from executing while other APIs are updating the same table. This feature can be useful when there is a high volume of simultaneous API requests affecting the same database records.

An example of this could be an incremental counter. If the same API is being hit simultaneously it's possible the same count number gets added more than once. With lock enabled on a get action, the get would be locked until other APIs complete updating, adding, or deleting in the same table. Once those operations have ended, the get can retrieve the records.

Last updated