Description Usage Arguments Value Examples
CDS Web API offers a variety of filtering functions that are not standard in Odata. They are very useful when it comes to limiting the number of rows you might want to retrieve from an entity. The problem is that writing them in a query is annoying to say at least. This function will generate a string that callse the specified filter function wirhout need to encapsulate strings in ticks or remembering how arrays of values are written in odata. See list of available filter functions here: Web API Query Function Reference
1 | cds_filter_fun(cds_fun_name, PropertyName = NULL, ...)
|
cds_fun_name |
A string representing the name of the filter function. Available functions: Web API Query Function Reference |
PropertyName |
Most filter functions work on at least one field from the base entity in your query. This argument allows you to specify this column as an R string. If a function does not use any fields from an entity, leave is as NULL (default value). |
... |
If a query function uses more arguments than just PropertyName, you can specify them here. As argument names use the same names as you can find in the documentation. |
A string that represents CDS Web API Odata call that can be used as argument in the Odata $filter system function. See usage examples.
1 2 3 4 5 6 7 8 9 | cds_filter_fun("On", PropertyName = "createdon", PropertyValue = "2020-02-21")
cds_filter_fun("Between", "sale", PropertyValues = c(100, 300))
## Not run:
download_cds(
"audits",
filter = cds_filter_fun("LastXFiscalYears", "createdon", PropertyValue = 2)
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.