Is it possible to run a modification action and then a function following it in workshop?

84 Views Asked by At

So i have a function which calculates ranks for countries but i want this function to be run when:

  1. user creates a scenario, submits some weightages and then run Fx
  2. User edits weightages, run Fx

But I am unable to define a function run after create/modify action. Is there any way to approach this?

I know the usual approach would be to store it in the function itself but since the weightages are being stored as part of scenarios and we are directly applying it to scenarios to calculate rank, the weightages are not stored in the writeback dataset.

Any advice would be helpful.

1

There are 1 best solutions below

0
On

There are a couple of ways you can approach this depending on the type of result your function gives.

If the function simply provides a metric, you can have a metric card backed by a variable that is scenario-aware. This variable should compute your Fx (country rank) and display the result based on the

scenario selected in your Scenario Manager or Scenario Selector widget

If the country rank is a Function backed property for your object, you can display it in an object table and make the object table widget scenario-aware. Similarly to the case above, once you select a scenario, the table will show you the values for the country rank based on the scenario parameters.