Visokio website     Downloads     Video tutorials     KnowledgeBase  
Scripting: DataManager Custom Script block - Visokio Forums
Scripting: DataManager Custom Script block
  •     acohen September 16, 2014 12:30PM
    I'm trying to do a couple of simple things using the DataManager Custom Script block.

    For an input array, I would like to loop through one of the fields and do a calculation but I am falling over at the first hurdle.

    How do I reference a field and record number of an input array for instance? Or return a full field from the input array? So I would try something like Input1[Baseball players] for example and hope to preview just that one field.

    Apologies, I am a real novice when it comes to JavaScripting.

    Thanks
  • 2 Comments
  •     Veaceslav September 17, 2014 7:01AM
    Ariel, please read this (look for the 'In scripts' functions):
    http://www.visokio.com/kb/functions-guide

    E.g. You can access the cell value in input1 for field 'Player', row 2 like this:
    input1.cell('Player', 2)

    You can take all values of a certain field like this:

    working = new Array();
    for (var i = 1; i <= input1.recordCount(); i++) {
    working.push(input1.cell('Player', i));
    }
    working;

Welcome!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership