Fetch Object Instance
Fetch Instance
This action fetches an object instance from the database which becomes the value of this action.
value is an instance
The value of this action has the data type object instance.
You can use dot notation to access its constituent field values.
The fetch instance action needs to know which instance you want.
We describe this by
- thinking of which instances we might want to consider (= defining filter conditions)
- then thinking how we might sort that collection of instances so that the one we want is first.
In fact, there are three steps to configuring the fetch, and they appear in this order:
- You specify how to sort the objects 2.Then you say which you want to pick from the sorted list (normally the first, but you might want second, third etc)
- You can also add field conditions to narrow down the selection to a specific collection
Example
Suppose we needed to
Fetch the invoice with the largest amount from the past 12 months
you would configure it like this:
- sort by the amount field
- pick the first instance from the sorted list
- and add a field condition on invoice date so that list you are picking the instance from contains only invoices from past 12 months
Fetch Specific Instance
If you know the primary key of the instance you want to fetch from the database, you configure like this:
- choose to sort by any field
- pick the first instance from the sorted list
- set a field condition on the unique field, specifying that the value of that field must include
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.