I’m implementing a custom app, and I wonder if it’s possible to use RPC in order to select values in a filter.
I already implemented an RPC that fetches a list of possible values from my API server.
I’m using it in a select
parameter, like you can see in the “Groups” in one of the screenshots.
However, I want to use the same functionality in a filter, and let the user select the groups in the fields pointed by the red arrow (the other screenshot).
The module’s Mappable Parameters:
[
{
"name": "textFilter",
"label": "Text Filter",
"type": "filter",
"grouped": false,
"options": {
"logic": "and",
"store": [
{
"label": "Email",
"value": "email"
},
{
"label": "Nickname",
"value": "nickname"
},
{
"label": "First Name",
"value": "firstName"
},
{
"label": "Last Name",
"value": "lastName"
},
{
"label": "Address",
"value": "address"
}
],
"operators": [
{
"label": "Text",
"options": [
{
"label": "Contains",
"value": "contains"
},
{
"label": "Equals",
"value": "equals"
},
{
"label": "Starts With",
"value": "startsWith"
},
{
"label": "Ends With",
"value": "endsWith"
},
{
"label": "Equals",
"value": "equals"
}
]
}
]
}
},
{
"name": "datetimeFilter",
"label": "Datetime Filter",
"type": "filter",
"grouped": false,
"options": {
"logic": "and",
"store": [
{
"label": "Created At",
"value": "createdAt"
},
{
"label": "Updated At",
"value": "updatedAt"
}
],
"operators": [
{
"label": "Datetime",
"options": [
{
"label": "Before",
"value": "lt"
},
{
"label": "On or before",
"value": "lte"
},
{
"label": "After",
"value": "gt"
},
{
"label": "On or after",
"value": "gte"
}
]
}
]
}
},
{
"name": "tags",
"type": "select",
"label": "Tags",
"options": "rpc://rpcTags",
"multiple": true
},
{
"name": "groups",
"type": "select",
"label": "Groups",
"options": "rpc://rpcGroups",
"multiple": true
},
{
"name": "limit",
"type": "uinteger",
"label": "Limit",
"default": 10,
"help": "Maximum number of returned contacts."
},
{
"name": "pageSize",
"type": "uinteger",
"validate": {
"max": 250
},
"label": "Page Size",
"default": 100,
"mappable": false,
"help": "Paging parameter. Number of contacts to return in one page.",
"advanced": true
}
]