Skip to content

Commit

Permalink
Merge pull request #107 from AlexaCRM/functionDescriptionUpdate
Browse files Browse the repository at this point in the history
update functions description
  • Loading branch information
georged authored Jan 11, 2025
2 parents 692eea3 + 8cb6273 commit 5636436
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 22 deletions.
20 changes: 0 additions & 20 deletions datapress/knowledge_base/devInfo/retrieve.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,6 @@ 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 Down
61 changes: 59 additions & 2 deletions datapress/using-twig/filters_and_function.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ DataPress (Dataverse Integration) provides several Dataverse-specific and genera

## Functions

### image_url

- `image_url()` - returns URL to the image stored in the specified Dataverse image column.

```twig
- image_url(
record,
Expand All @@ -33,7 +37,10 @@ DataPress (Dataverse Integration) provides several Dataverse-specific and genera
}
)
```
-- returns URL to the image stored in the specified Dataverse image column.

### file_url

- `file_url()` - returns download URL for the file stored in the specified Dataverse file column.

```twig
- file_url(
Expand All @@ -46,8 +53,58 @@ DataPress (Dataverse Integration) provides several Dataverse-specific and genera
}
)
```
-- returns download URL for the file stored in the specified Dataverse file column.

### last_error

- `last_error()` - returns last error generated by the Twig provider.

### entity_url

- `entity_url( record, postId = null )` -- returns URL to the website page with the given entity record bound to it. Uses [Table Binding](/datapress/binding/table-binding.md) feature. If more than one WordPress post is bound to the table, you can pass post ID to link to a different page instead.

### retrieve_multiple

- `retrieve_multiple()` - retrieve Dataverse records using Web API twig functions

**Parameters:**

**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.

### retrieve

- `retrieve()` - retrieve a single Dataverse record using Web API twig functions

**Parameters:**

**entity**: This specifies the name of the entity from which records are being retrieved.

**select**: A list of the fields to be returned for a record.

**guid**: This parameter is used to filter the record by id.

**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).

:::tip

[Examples of using **retrieve()** and **retrieve_multiple()**](/knowledge-base/retrieve-records)
:::

0 comments on commit 5636436

Please sign in to comment.