# Refreshing Parameter Sheet Visuals with Javascript Tool

**URL:** https://qa.fmod.com/t/refreshing-parameter-sheet-visuals-with-javascript-tool/22343
**Category:** FMOD Studio
**Tags:** javascript
**Created:** [November 25, 2024, 2:12pm UTC](https://qa.fmod.com/t/refreshing-parameter-sheet-visuals-with-javascript-tool/22343 "2024-11-25T14:12:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![robindemute](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@robindemute](https://qa.fmod.com/u/robindemute)
#### Post date: [November 25, 2024, 2:12pm UTC](https://qa.fmod.com/t/refreshing-parameter-sheet-visuals-with-javascript-tool/22343/1 "2024-11-25T14:12:58Z")

</div>

Hello there,

I’ve been messing around with Javascript tools for Fmod, one of the tools I’m writing creates a labeled parameter sheet for an event.

When this parameter sheet is created, the parameter sheet only shows the first labeled value.

 ![Capture](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/6/649c802302384058438f26ac29dca016540d4da1.png)  
I need to open the edit parameter window and then just press ok to have it show all the labeled values like it should.  
I’m guessing theres some kind of visual update function I’m not calling in my code and I was wondering what it was.

Here is the script I’m running:

```auto
studio.menu.addMenuItem({
    name: "Create Switch Sound",
    isEnabled: true,
    execute: createSwitchSound,
});

function createSwitchSound() {
    const eventSwitch = studio.project.create("Event");
    eventSwitch.name = "SwitchSound";

    const param = eventSwitch.addGameParameter({
        name: "ParameterTest",
        type: studio.project.parameterType.UserEnumeration,
    });
    
    param.preset.isGlobal = true;
    
    param.preset.enumerationLabels = ["label1", "label2","label3","label4","label5","label6"];

    const track = eventSwitch.masterTrack;

    const instrument = track.addSound(param, "EventSound", 1, 1);
        
    //param.properties.dump();
}

```

Thanks in advance.

---

<div class="post-metadata">

### Author: ![robindemute](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@robindemute](https://qa.fmod.com/u/robindemute)
#### Post date: [November 25, 2024, 3:04pm UTC](https://qa.fmod.com/t/refreshing-parameter-sheet-visuals-with-javascript-tool/22343/2 "2024-11-25T15:04:13Z")

</div>

Found the problem, it’s because the parameter’s maximum is set to a number lower than the amount of labels.

```auto
const paramArr = ["label1", "label2","label3","label4","label5","label6"];
    
    param.preset.enumerationLabels = paramArr;
    
    param.preset.maximum = paramArr.length;

```

This solved my issue.
