Filtering in a dynamic sheet using dynamic conditions

If you need to filter a dynamic list of type User, Org. Unit, or Role to a specific value, there are multiple options available.

One of them is to use dynamic conditions and the varDefOn function and set dlUrl parameter

The dlUrl parameter calls the TASU API directly. Therefore, we can pre-filter the values ​​directly in the roles table and then use the filter in the URL definition.

Use case:

Need to filter a dynamic list by a variable on a form or a variable in a case.

An example is demonstrated:
  • In process Mail | Inbox
  • Variables of type Dynamic List of type Role with technical name receiverGroup (CZ: Role of mail recipients)
  • Variable selectedCategory of type text code list used only for demonstrating category selection

Procedure

  1. To find out the URL filter, it is a good idea to turn on DevTool in the browser (F12 key) and open the Network tab.
  1. Then filter the value, e.g. Category within Roles
  1. In the network tab, you can then see the call to the application backend and you can copy it, just the part after the last slash.

roles?offset=0&limit=22&filter=role_category%3Clike%3E%22%25TST%25%22&order=role_name,id&sort=asc,asc

  1. Then paste the copied code into this tool, for example, and use Decode to get a notation that can be used in TAS.

https://meyerweb.com/eric/tools/dencoder/

Decode value:

roles?offset=0&limit=22&filter=role_category<like>"%TST%"&order=role_name,id&sort=asc,asc

  1. You can delete offset and limit from the code. By default, limit limits the selection to 27 values ​​and it might not display everything.

roles?filter=role_category<like>"%TST%"&order=role_name,id&sort=asc,asc

  1. Then, within the dynamic conditions, define the behavior, for example, as follows: We dynamically insert the value from the selectedCategory variable into the string.
varDefOn('receiverGroup', true, () => {
const filter = `/roles?filter=role_category<like>"%${vSync('selectedCategory')}%"`
return {
tvar_meta: {
dlUrl: filter
}
}
}
)
  1. The variable now only displays values ​​from the selected category:

Frantisek Brych Updated by Frantisek Brych

Search in a dynamic table by column value

Optimizing Overviews with a Large Number of Cases

Contact

Syca (opens in a new tab)

Powered by HelpDocs (opens in a new tab)