Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update functions description #107

Merged
merged 1 commit into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions datapress/knowledge_base/devInfo/retrieve.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,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)
:::
Loading