# How can I get sheet content by javascript?

**URL:** <https://qa.fmod.com/t/how-can-i-get-sheet-content-by-javascript/21176>\
**Category:** FMOD Studio\
**Created:** [January 31, 2024, 7:35am UTC](https://qa.fmod.com/t/how-can-i-get-sheet-content-by-javascript/21176 "2024-01-31T07:35:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MisakaCirno](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@MisakaCirno](https://qa.fmod.com/u/MisakaCirno)\
**Post date:** [January 31, 2024, 7:35am UTC](https://qa.fmod.com/t/how-can-i-get-sheet-content-by-javascript/21176/1 "2024-01-31T07:35:44Z")

</div>

This has some relevance to my last post, see: [About WebGL project load bank and memory useage](https://qa.fmod.com/t/about-webgl-project-load-bank-and-memory-useage/21071)

I’m going to analyze the dependencies in an Event for other Banks via JavaScript.  
Currently I have an Event that has a Parameter Sheet, how should I get what Parameters the Parameter Sheet corresponds to, and what Events are on Tracks?

* * *

 ![FMOD](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/8/884f402426f4b19bd9351aa7fa96a5e6cb578006.png)

For example, I would like to be able to analyze the **New Event** in the diagram by code and know that it has a Parameter Sheet called **TestParameterAAA**.

The Parameter corresponding to Sheet **TestParameterAAA** is **TestParameterAAA**.  
(I realized that the name of this Sheet seems to be linked to the name of the Parameter, and if the name of the Sheet is changed, the name of the Parameter is also changed)

**TestParameterAAA** has three values, **Value A** , **Value B** , and **Value C**. In this Sheet, they correspond to **TestEvent1** , **TestEvent2** , and **TestEvent3**.

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [February 1, 2024, 1:51am UTC](https://qa.fmod.com/t/how-can-i-get-sheet-content-by-javascript/21176/2 "2024-02-01T01:51:21Z")

</div>

Assuming you have a reference to your event as `event` already:

```auto
// list of all paremeters used by the event
event.parameters;
// get name of parameter i
event.parameters[i].preset.presetOwner.name;
// get list of labels for values of parameter i
event.parameters[i].preset.enumerationLabels;

// get name of instrument j on parameter i
event.parameters[i].modules[j].name;
// get starting parameter value of instrument j on parameter i
event.parameters[i].modules[j].start;
// get length of instrument j on parameter i
// this is in case it spans multiple parameter values
event.parameters[i].modules[j].length;

```

---

<div class="post-metadata">

**Author:** ![MisakaCirno](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@MisakaCirno](https://qa.fmod.com/u/MisakaCirno)\
**Post date:** [February 27, 2024, 6:47am UTC](https://qa.fmod.com/t/how-can-i-get-sheet-content-by-javascript/21176/3 "2024-02-27T06:47:16Z")

</div>

I have a more similar question, how do I get the **Action Sheet** and **Timeline Sheet** for Event?  
Also, is `event.parameters` the mapping to the **Parameter Sheet**?

---

<div class="post-metadata">

**Author:** ![MisakaCirno](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@MisakaCirno](https://qa.fmod.com/u/MisakaCirno)\
**Post date:** [February 27, 2024, 10:37am UTC](https://qa.fmod.com/t/how-can-i-get-sheet-content-by-javascript/21176/4 "2024-02-27T10:37:32Z")

</div>

I seem to be able to get all the ActionSheets by way of `studio.project.model.ActionSheet.findInstances()` and get which Event the ActionSheet exists in by way of `actionSheet.event`.  
Is there a way to get if it has an ActionSheet by Event?

* * *

How do you get each Instrument in an ActionSheet? I guess maybe `actionSheet.modules.sounds`.

* * *

How do I get what specific action a Command Instrument performs?  
I selected `Set Parameter` for `Command Type` in Command Instrument, which seems to correspond to `actionSheet.modules.sounds[0].commandType`.  
The `Value` parameter seems to correspond to `actionSheet.modules.sounds[0].targetValue`.  
The `Target` parameter seems to correspond to `actionSheet.modules.sounds[0].commandTarget`, which is an instance of `ManagedObject:GameParameter`.

I don’t know if my speculation is correct.

* * *

In `actionSheet.modules.sounds[0].commandTarget`, an instance of `ManagedObject:GameParameter` is available, but it does not have a member with `name`.  
The `ManagedObject:ParameterPreset` is the instance with the `name` member, which is consistent with what is shown in FMOD Studio’s Preset Browser.  
What is the relationship between `ManagedObject:GameParameter` and `ManagedObject:ParameterPreset`?

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [March 5, 2024, 2:21am UTC](https://qa.fmod.com/t/how-can-i-get-sheet-content-by-javascript/21176/5 "2024-03-05T02:21:54Z")

</div>

> [@MisakaCirno](#):
>
> Is there a way to get if it has an ActionSheet by Event?

Action sheets are stored in the `event.parameters` array as an object of type `ManagedObject:ActionSheet`.

> [@MisakaCirno](#):
>
> How do you get each Instrument in an ActionSheet? I guess maybe `actionSheet.modules.sounds`.

Internally, instruments in an action sheet are stored in a multi-instrument, so yes, `actionSheet.modules.sounds` is what you want.

> [@MisakaCirno](#):
>
> How do I get what specific action a Command Instrument performs?  
> […]  
> I don’t know if my speculation is correct.

Your speculation is correct.

> [@MisakaCirno](#):
>
> What is the relationship between `ManagedObject:GameParameter` and `ManagedObject:ParameterPreset`?

A `GameParameter` is a parameter associated with an event, and can have a value which effects event behaviour - it can be a built-in parameter that has its value calculated by FMOD, or can have its value set by the user.

A `ParameterPreset` is an object representing a “preset parameter”, which is essentially a template for that specific type of parameter. The type, properties, default values, etc. of `GameParameter` are taken from the corresponding `ParameterPreset`.

Please see our documentation on [`model.GameParameter`](https://www.fmod.com/docs/2.02/studio/scripting-api-reference-project-model-parameter.html#modelgameparameter) and [`model.ParameterPreset`](https://www.fmod.com/docs/2.02/studio/scripting-api-reference-project-model-parameter.html#modelparameterpreset) for more info.

---

<div class="post-metadata">

**Author:** ![MisakaCirno](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@MisakaCirno](https://qa.fmod.com/u/MisakaCirno)\
**Post date:** [March 5, 2024, 2:51am UTC](https://qa.fmod.com/t/how-can-i-get-sheet-content-by-javascript/21176/6 "2024-03-05T02:51:49Z")

</div>

> [@Leah\_FMOD](#):
>
> A `ParameterPreset` is an object representing a “preset parameter”, which is essentially a template for that specific type of parameter. The type, properties, default values, etc. of `GameParameter` are taken from the corresponding `ParameterPreset`.

Do you mean:

When a Parameter is used on an Event, the various parameters initialized by that Parameter come from the `ParameterPreset`, and when the Parameter is modified, the various contents of the `GameParameter` may change, but the `ParameterPreset` does not change at all.  
The `ParameterPreset` is like a “production template”, and every new `GameParameter` is created according to it.

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [March 6, 2024, 1:20am UTC](https://qa.fmod.com/t/how-can-i-get-sheet-content-by-javascript/21176/7 "2024-03-06T01:20:26Z")

</div>

> [@MisakaCirno](#):
>
> The `ParameterPreset` is like a “production template”, and every new `GameParameter` is created according to it.

Simply put, yes, what you’ve said is essentially correct.
