Please check your agent type and version and read on or switch to the right documentation.
Smart segment to restrict access to an action on a record details view
Context: As a user, I want to enable or not a smart action for a record depending on the value of a smart field.
In this example, the user wants to enable the access to a smart action called restricted action for a collection customers solely for customers that have registered orders. In our data models a customer hasMany orders.
The behavior observed above corresponds to this implementation in the file customers.js
This works only at the level of a records details view as we are looking to catch the query made to ensure that the action should be visible. This query is structured this way and allows us to implement the logic above by retrieving the record id present in the filter:
{ segment:'Customers with orders', filters:'{"field":"id","operator":"equal","value":"67573"}', timezone:'Europe/Paris'}