How to reset / remove parameters using custom styles / ARCAPI JS

To interact with parameters within dashboards you can use the Arcadia JS APIs mentioned here:
http://documentation.arcadiadata.com/4.5.0.0/#pages/topics/arcapi-cust-exten-js-apis.html#arcapi-cust-exten-js-apis-arcapi-functions

Specifically the getParameters() and sendParameters() API.

If you ever want to reset / remove a specific parameter you can simply use the sendParameters API specifying the “key” and an empty / null value as shown below:

  arcapi.sendParameters({"Order Priority": []});

This will remove/unset the “Order Priority” parameter.

image image

1 Like

Hi Shaun,

I have try this on several version of arcadia from 4.2, 4.5.0 (instant) and 4.4 (Enterprise).
But is not working. The key of filter remain in the list.

E.g:
Before
Name: Lorenzo
Surname: Latta

After
Name:
Surname:

var resetFilter = function() {
  let paramFilter = arcapi.getParameters();

  let keys = Object.keys(paramFilter);

  keys.forEach(k => {
    console.log("keys: " + k);

    let objectFilter = {};
    objectFilter[k] = [];
    arcapi.sendParameters(objectFilter);
  })
};

I have tried to assign the filter value to [ ], null and undefined but the result doesn’t change.
Could you support me?

Thanks
Lorenzo

@lorenzo.latta can you try just setting each one explicitly one by one using sendParameters?

@lorenzo.latta not sure your exact use-case. If you have filter widgets on the page, resetting them using this might not work correctly. I see some issues.