Creating a filter for an export
By adding a report to a templated report you may want to add a filter to your export to filter out redundant or unnecessary reports for your needs. Adding a filter to reports works a bit differently then with adding other filter to workflows, report and etc.
For a export report it is required to be in a URL encoded format which consists of different characters such as a '%5B' is used for a bracket '['. However the structure remains the same as a normal filter for a report and you can find websites online to help you encode and decode a filter string.
To encode your filter string, you first would need to create a filter string which you can read more here, which you can also find information about an export filter string.
The structure of a filter string looks like the following:
$filter=[FieldIdentifier] eq 'Value'
To create an export filter string from this filter string you would first need to remove the dollar sign '$' and encode the string '[FieldIdentifier] eq 'Value' following the '=' into a URL format to look like the following. A website I would recommend to encode the filters is URL Encode Online | URLEncoder:
filter=%5BFieldIdentifier%5D%20eq%20%27Value%27
Example
An example where an export filter would come in useful would be from a To Do List where the user would want to export a list report of only the tasks which have not been completed.
Currently, this list report in a To Do app shows all the records which has been created and the templated report has the following string in the templated report. Where ToDoV2 is the ID of the app and ToDo if the ID of the report.
@Report(ToDoV2, ToDo)
To filter out the completed tasks we would need to add a filter string which filters out the completed field. The completed field is an image list with two values being 'Ticked' and 'Unticked'. A filter string to filter out the completed records would look like the following:
$filter=[Completed] eq 'Unticked'
By following the process above we remove the dollar '$' and encode '[Completed] eq 'Unticked'.
Which leaves the following string:
@Report(ToDoV2, ToDo, filter=%5BCompleted%5D%20eq%20%27Unticked%27)
With this change in the templated report the export now looks like the following where the export has successfully filtered out the completed records.
Please sign in to leave a comment.
Comments
0 comments