Pass Object Javascript Block (Mobile)

Pass Object Javascript Block (Mobile)

  

How to pass a Javascript Object to a Javascript Block like a Json

Hi Filipe,


One way is to convert a structure do JSON, pass it as a Text parameter and then parse inside the block:



Cheers,

Renato


Filipe Lourenço wrote:

How to pass a Javascript Object to a Javascript Block like a Json



So although the javascript block has the Object type is not possible to pass as an object

Where is the Object coming from originally?

For example... in the MediaWithCompression Plugin Wrapper I created... I created a new Media object.  I needed this Media Object in other Javascript Modules and I couldn't see a way of passing an Object out via a parameter.

So... I used "this".  E.g. 

var mediaRec = new Media(... all the media stuff...);

this.mediaRecObject - mediaRec;

Then, in another Javascript Module I could do this...

var mediaRec = this.mediaRecObj;

Essentially, this is creating a global namespace variable containing the Object.


Filipe,


I could pass and use an Object like so (TestStruct is an OutSystem structure):


The structure is:


Filipe Lourenço wrote:

So although the javascript block has the Object type is not possible to pass as an object