Skip to content

Commit

Permalink
Merge pull request #104 from AlexaCRM/updateRetrieve
Browse files Browse the repository at this point in the history
  • Loading branch information
georged authored Jan 8, 2025
2 parents 1ccc4a5 + 9bda2c9 commit 6ea0ad4
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions datapress/knowledge_base/devInfo/retrieve.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@ skipToken:null
</ul>
```

**entity**: This specifies the name of the entity from which records are being retrieved. In this case, the entity is contact.

**select**: A list of the fields to be returned for each record. Here, the columns specified are fullname and ownerid.

**filter**: This parameter is used to filter the records based on specified value.

**order**: Specifies the ordering of the returned records. The key is the column logical name and the value is the sort direction.

**expand**: Used to include related entities or additional data from related entities in the results. This parameter can help fetch detailed information from linked entities. Other examples:
- parentcustomerid_account($select=name,telephone1,accountid)
- transactioncurrencyid($select=isocurrencycode).

**top**: Limits the number of records returned. Here, it is set to 2, meaning only the top 2 records will be returned.

**includeCount**: This should be a boolean value. If set to true, the total record count can be retrieved using `{{ records.TotalRecordCount }}`. In this example, it is set to null, meaning the count is not included.

**skip**: Specifies the records to skip. It is set to null here, meaning no records are skipped.

**skipToken**: Used for pagination. When set to null, it indicates there is no token used for skipping records.

Here is an example of how to retrieve a single record:

```twig
Expand All @@ -45,5 +65,14 @@ expand:"ownerid"
<li><b>ID:</b> {{record1["accountid"]}} <b>Name: </b>{{record1["name"]}} |{{record1["ownerid"].Name}}</li>
```
An example of how to retrieve a record by reference:

```twig
{% set recordOne = retrieve("account", "c7e9ab7e-98ff-e811-a980-000d3aa0f423", "ownerid") %}
{% set recordRef = recordOne|to_entity_reference %}
{% set recordByRef = retrieve(recordRef) %}
<li><b>ID:</b> {{recordByRef["accountid"]}} <b>Name: </b>{{recordByRef["name"]}}</li>
```

For more information about function see [Filters and function](/datapress/using-twig/filters_and_function.md)

0 comments on commit 6ea0ad4

Please sign in to comment.