Showing results for 
Search instead for 
Did you mean: 

Attaching different scripts to different list entries in the drop down list

0 Kudos


I would like to use the drop down list as a way to run different scripts. So for example, when i choose "Timlønnet" i want to run a specific script, and a different script if i choose "Medarbejder i løntilskud". 

I think i would need to create a script for the "onSelect" event on the dropdown list that uses an If/else or maybe else/if method, but i have not been able to find an example here in the SAP Community about how to do this.

Hope you can help, thank you!



Accepted Solutions (0)

Answers (1)

Answers (1)

Product and Topic Expert
Product and Topic Expert
0 Kudos

You're on the right track, and yes, you can do this. Here are the steps for an example:

  • Add your dropdown control to the flavor and insert the entries for the scripts you want to run. As key values, you could use something simple, like numbers 1,2,3 etc.
  • Add your scripts you want to run based on the dropdown selection. Note their ID, which you can find at the top of the script editor window. You can simply click on this to copy it into the clipboard:
  • Create a new script that drives the selection. The currently selected key value is provided in variable newKey
    The script could look something like this:


/* globals newKey */
var scriptNumber = newKey;
switch (scriptNumber) {
    case "1":
    case "2":


Of course, you need to paste your own script IDs at the appropriate places.

  • Assign this new script to the onSelect event of your dropdown and it should work the way you wanted.