You are using a version of internet explorer not supported by this system. Please update your browser to Google Chrome to continue.

Topics

General

Account

Projects

Toolset

Client Management

Other

Batch Script Automation in Tabx

Contents


Tabx offers a way to script the management of Single Categorical Variables, Multi Categorical variables and Groups within a Project. The Batch Script tool can be found in the Edit Project page > Script Tab. A Batch script is simply a spreadsheet with two columns inside: "Instruction" and "Value".

When parsed and executed, Tabx walks through the instructions row by row and uses any value it needs to in the "Value" column.

Running a Batch Script

To run a Batch Script, simply upload the excel file and press Run. Tabx will display an output of all actions taken, as well as any errors within the script, after the script executes. To get a preview of what Tabx will do without making any additions or edits to the current Project, press Preview instead of Run. If the script output is correct, reupload the batch script to execute.

The available instructions are:

General
Instruction Outcome Expected values Errors on:
FOR_PROJECT Ties a batch script so it will only run on a project with the defined name in the value column. This is recommended to prevent scripts from running accidentally in similar projects. FOR_PROJECT is optional in a batch script file. String of the project name to tie this batch script file to. If the project name is not the project this batch script is being uploaded to (prevents all further execution)
Single Categorical Variables
Instruction Outcome Expected values Errors on:
EDIT_SINGLE* Tabx begins an edit of a Single type variable already in the Project The Tabx Single identifier If already within another definition operation.
END_EDIT_SINGLE* Tabx makes the edit to a current Single type variable within the Project "YES" or Blank If EDIT_SINGLE has not yet been called.
SINGLE_LABEL Set the Label Text of the current definition. String of text to use as Label If EDIT_SINGLE has not yet been called.
SINGLE_GROUP Set the Group of the current definition. Positive integer in range 1 – 20. Defaults to 0 (No Group) if not set. If EDIT_SINGLE has not yet been called.
SINGLE_FILTER Set whether a filter in the current definition. "YES" or "NO". Defaults to "NO" if not set. If EDIT_SINGLE has not yet been called.
SINGLE_SUBSET Set whether a filter in the current definition. "YES" or "NO". Defaults to "NO" if not set. If EDIT_SINGLE has not yet been called.
SINGLE_CATEGORY Define which Answer Code's Label to edit with a following SINGLE_CAT_LABEL instruction. Positive integer of the Answer Code If EDIT_SINGLE have not yet been called.
If answer code does not exist in variable.
If next row is not a SINGLE_CAT_LABEL instruction.
SINGLE_CAT_LABEL Set the label text for an Answer Category within the current definition. String of text to use as label. Defaults to "No Label" if not set. None – is ignored unless called directly after a SINGLE_CATEGORY instruction.
Multi Categorical Variables
Instruction Outcome Expected values Errors on:
START_NEW_MULTI** Tabx sets up a new Multi Categorical Variable definition to add meta data into. Blank, or your chosen reference to this Multi Variable. Note: This will be stored as the "given_name" for this Multi inside Tabx, but from the point of creation, Tabx will use its own identifier for making batch edits. Be sure to use the Tabx identifier when using the EDIT_MULTI instruction.   If already within another definition operation.
If already Editing a Multi via EDIT_MULTI command.
END_NEW_MULTI** Tabx closes the current Multi definition and adds it to the list of current Multi’s "YES" or Blank If START_NEW_MULTI has not yet been called.If MULTI_LABEL has not yet been called (Definition has no Variable Label).If MULTI_CATEGORY has not yet been called (Definition contains no categories).
EDIT_MULTI** Tabx begins an edit of a Multi already in the Project The Tabx Multi identifier, always in the format MX, where X = a positive integer. If already within another definition operation.If already Editing a Multi via EDIT_MULTI command.
END_EDIT_MULTI** Tabx makes the edit to a current Multi within the Project "YES" or Blank If EDIT_MULTI has not yet been called.
If MULTI_CATEGORY has not yet been called (Definition contains no categories).
MULTI_LABEL** Set the Label Text of the current Multi definition. String of text to use as Label If EDIT_MULTI or START_NEW_MULTI have not yet been called.
MULTI_GROUP Set the Group of the current New or Edit definition. Positive integer in range 1 – 20. Defaults to 0 (No Group) if not set. If EDIT_MULTI or START_NEW_MULTI have not yet been called.
MULTI_FILTER Set whether a filter in the current New or Edit definition. "YES" or "NO". Defaults to "NO" if not set. If EDIT_MULTI or START_NEW_MULTI have not yet been called.
MULTI_CATEGORY* Set a single-type variable to use within the current New or Edit definition. Single-type variable name. If EDIT_MULTI or START_NEW_MULTI have not yet been called.If single-type variable does not exist in project.If single-type variable chosen is not Multi-Friendly (Uses Codes 0 and 1).If next row is not a MULTI_CAT_LABEL instruction.
MULTI_CAT_LABEL Set the label text for an Answer Category within the current New or Edit definition. String of text to use as label. Defaults to "No Label" if not set. None – is ignored unless called directly after a MULTI_CATEGORY instruction.
Groups
Instruction Outcome Expected values Errors on:
EDIT_GROUP Tabx begins an edit of a Group already in the Project Positive integer in range 1 – 20. If already within another definition operation.
If the value is not in the range 1-20
END_EDIT_GROUP Tabx makes the edit to a current Group within the Project "YES" or Blank If EDIT_GROUP has not yet been called.
GROUP_LABEL Set the Label Text of the current Group definition. String of text to use as Label If EDIT_GROUP has not yet been called.

* Required as part of a Single type variable Definition
** Required as part of a Multi Definition

Script Rules

Your batch script must adhere to the following rules to execute correctly:

  • Only entries in cell columns A and B will be parsed. Any values in cell columns C further will be ignored - notes can be kept in these columns.
  • A "Definition" means all instructions between instructions START_NEW_MULTI and END_NEW_MULTI,  EDIT_MULTI and END_EDIT_MULTI, EDIT_SINGLE and END_EDIT_SINGLE, EDIT_GROUP and END_EDIT_GROUP. 
    • A Multi Definition must include:
      • 1 of START_NEW_MULTI or 1 of EDIT_MULTI
      • 1 of MULTI_LABEL
      • 1 or more of MULTI_CATEGORY
      • 1 of END_NEW_MULTI or END_EDIT_MULTI
      • MULTI_GROUP and MULTI_FILTER instructions are always optional, and will use default values if not set (see table above).
  • Rows can be blank between instruction rows. See example below.
  • A header row of "Instruction" and "Value" is not required.
  • The final instruction in the batch script must be either END_EDIT_SINGLE, END_NEW_MULTI, END_EDIT_MULTI or END_EDIT_GROUP.

Script Processing Behaviour

When executing your batch script, Tabx does the following:

  • All new Multi Definitions are collected and added to the Project after the Batch Script has completed.
  • When editing Multi’s, all existing answer categories are REMOVED before re-adding the newly defined answer categories within the Edit Multi Definition.

Example Script

Below is an example script that adds two new multi’s to the Project and edits the categories for existing Tabx Multi "M1". It will only execute for the project named "Demo Project".

Instruction Value Comment
FOR_PROJECT Demo Project //tie this batch script to the "Demo Project" project.
START_NEW_MULTI eaten_1_3 //start a new multi definition
MULTI_LABEL Have you eaten the following in the last 30 days?
MULTI_GROUP 1
MULTI_FILTER YES
MULTI_CATEGORY eaten_1
MULTI_CAT_LABEL Snickers
MULTI_CATEGORY eaten_2
MULTI_CAT_LABEL Mars
MULTI_CATEGORY eaten_3
MULTI_CAT_LABEL Twirl
END_NEW_MULTI YES
START_NEW_MULTI eaten_4_5 //start a new multi definition
MULTI_LABEL Have you eaten the following in the last 30 days?
MULTI_GROUP 1
MULTI_FILTER YES
MULTI_CATEGORY eaten_4
MULTI_CAT_LABEL Cream Egg
MULTI_CATEGORY eaten_5
MULTI_CAT_LABEL Kit Kat
END_NEW_MULTI YES
EDIT_MULTI M1 //Edit M1 with new categories and labels.
MULTI_LABEL Have you eaten the following in the last 90 days?
MULTI_GROUP 2
MULTI_FILTER NO
MULTI_CATEGORY eaten_1
MULTI_CAT_LABEL Snickers
MULTI_CATEGORY eaten_2
MULTI_CAT_LABEL Mars
MULTI_CATEGORY eaten_3
MULTI_CAT_LABEL Twirl
END_EDIT_MULTI YES

See Also

Basic Project Management in Tabx

Register Free

Lifetime license, 1000 rows / 200 variables per project, 2 project slots.

This website uses cookies. Privacy Policy