KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums KX Solutions Dashboards – action triggers on page load Re: Dashboards – action triggers on page load

  • dcrossey

    Member
    August 8, 2021 at 12:00 am

    Hi Nick,

    You could try passing in a boolean viewstate triggerEnabled to your virtual datasource, which has a default value as false when the page loads to prevent it clearing.

    Something like:

     

    function (x, triggerEnabled, callback){ if(!triggerEnabled) { callback(x) // i.e. just return x without modifying } else { callback ({ // i.e. your custom clear logic }); } }

     

    Set the viewstate to true when you actually want to clear the viewstates.

    You can also map an output viewstate to reset the triggerEnabled viewstate to false after execution.

    Hope this helps!

    Cheers,

    David