How to: Number Rows Using the Create Index Operator

Prev Next

There are many ways to use the Create Index operator. You can use it to add new rows of information to an existing data table, or use it to filter out a specific row of data. You can also use it to number each row of a data table.

Let's say you have a table of patients, and you want to assign each a number. You can use the Create Index operator to assign these numbers.

Configuration

In this article, you'll learn how to use the Create Index operator to number table rows.

These instructions assume you have a new module open, saved, and with a title.

Configure the Data Table Component

First, you'll set up a Data Table component with a list of patient names, dates of birth, and insurance status.

  1. In the Module Builder, drag and drop a Data Table component onto your canvas.

  2. In the Property ID and Label Text fields, enter dtPatients.

  3. In the data table, enter the following:

    firstName

    lastName

    dob

    insurance

    Art

    Venere

    11/11/1988

    Yes

    Alisha

    Slusarski

    6/30/1974

    No

    Blair

    Malet

    12/22/2000

    Yes

    Willow

    Kusko

    5/27/1984

    No

    Meaghan

    Garufi

    4/13/1994

    Yes

    Abel

    Maclead

    2/18/1965

    Yes

    Willow

    Kusko

    5/27/1984

    No

    Ernie

    Stenseth

    6/1/1966

    Yes

    Jose

    Stockham

    11/11/1988

    Yes

  4. Click Save Component.

Configure the Initializer Component

Now, you'll set up an Initializer component to trigger the Data Workflow you add in a later step.

  1. Drag and drop an Initializer component onto your canvas, placing it below your Data Table component.

  2. In the Property ID and Canvas Label Text fields, enter initPatients.

  3. From the Trigger Type drop-down, select New Submission.

  4. In the Outputs table, enter the following:

    #

    Source

    Type

    Value

    1

    dwfPatients

    trigger

    GO

  5. Click Save Component.

Configure the Hidden Components

In the first Hidden component, you'll store your Data Workflow's output. In the second, you'll store the index data. That way, you can display stored data and your new data in the same dashboard.

  1. Drag and drop two Hidden components onto your canvas, placing one after the other below your Initializer component.

  2. In the Property ID and Canvas Label Text fields for each component, enter the following:

    #

    Property ID

    Canvas Label Text

    1

    patients

    patients

    2

    vgIndex

    vgIndex

  3. Set Store Data in Database to (ON) for both hidden components.

  4. Click Save Component for each Hidden component as you add it.

Configure the ViewGrid Component

Next, let's add a ViewGrid component so your end-user can view the patient information.

  1. Drag and drop a ViewGrid component onto the canvas, placing it below your Data Table component.

  2. In the Property ID field, enter gridPatients.

  3. In the Label Text field, enter Patients.

  4. In the Action field, enter null.

  5. In the Inputs table, enter the following:

    #

    Source

    Required

    1

    patients

    Not required

  6. In the Outputs table, enter the following:

    #

    Source

    Mapping

    1

    vgIndex

    index

  7. In the Display table, enter the following:

    #

    ID

    Formula

    Heading

    1

    patientIndex

    Chart Number

    2

    firstName

    First Name

    3

    lastName

    Last Name

    4

    dob

    Date of Birth

    5

    insurance

    Insurance

  8. Click Save Component.

Configure the Data Workflow Component

Now, you'll set up your Data Workflow component with a Create Index operator that adds a number to each row of your table. Instead of beginning your list with the default [0], you’ll begin with [1]. So, [1] represents the first row of your data table, and subsequent numbers represent table rows from top to bottom. You'll also add a Console operator so you can view the results in the DevTools Console.

  1. Drag and drop a Data Workflow component onto your canvas, placing it below your ViewGrid component.

  2. In the Property ID and Canvas Label Text fields, enter dwfPatients.

Configure the First Input Operator

  1. Drag and drop an Input operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Component

    dtPatients

    Required

    No

    Source

    Default

Configure the Create Index Operator

  1. Drag and drop a Create Index operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Create Index

    Label

    Patients

    Index Name

    patientIndex

    Starting Index

    1

    Keys

  3. Connect the output port (right) of the dtPatients Input operator to the input port (left) of the Patients Create Index operator.

Configure the Output Operator

  1. Drag and drop an Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    patients

    Action

    value

  3. Connect the output port (right) of the Patients Create Index operator to the input port (left) of the patients Output operator.

Configure the Console Operator

  1. Drag and drop a Console operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Console

    Label

    Indexed Patients

  3. Connect the output port (right) of the Patients Create Index operator to the input port (left) of the Indexed Patients Console operator.

  4. Click Save Component.

  5. Save your module.

The fully configured Data Workflow component looks like the following:

Here's how your module looks in the Module Builder:

Preview your module and open up the DevTools Console. You can see patient information from your Data Table component populate in your dashboard. In the DevTools Console, you can see the index numbers associated with each row of data.

There are many ways to use the Create Index operator. You can use it to add new rows of information to an existing data table, or use it to filter out a specific row of data. You can also use it to number each row of a data table.

Let's say you have a table of patients, and you want to assign each a number. You can use the Create Index operator to assign these numbers.

In this article, you'll learn how to use the Create Index operator to number table rows.

Configuration

In this how-to guide, you'll learn how to use the Create Index operator to number table rows.

These instructions assume you have a new module open, saved, and with a title.

Configure the Data Table Component

First, you'll set up a Data Table component with a list of patient names, dates of birth, and insurance status.

  1. In the Module Builder, drag and drop a Data Table component onto your canvas.

  2. In the Property ID and Label Text fields, enter dtPatients.

  3. In the data table, enter the following:

    firstName

    lastName

    dob

    insurance

    Art

    Venere

    11/11/1988

    Yes

    Alisha

    Slusarski

    6/30/1974

    No

    Blair

    Malet

    12/22/2000

    Yes

    Willow

    Kusko

    5/27/1984

    No

    Meaghan

    Garufi

    4/13/1994

    Yes

    Abel

    Maclead

    2/18/1965

    Yes

    Willow

    Kusko

    5/27/1984

    No

    Ernie

    Stenseth

    6/1/1966

    Yes

    Jose

    Stockham

    11/11/1988

    Yes

  4. Click Save & Close.

Configure the Initializer Component

Now, you'll set up an Initializer component to trigger the Data Workflow you add in a later step.

  1. Drag and drop an Initializer component onto your canvas, placing it below your Data Table component.

  2. In the Property ID and Canvas Label Text fields, enter initPatients.

  3. From the Trigger Type drop-down, select New Submission.

  4. In the Outputs table, enter the following:

    #

    Property ID

    Type

    Value

    1

    dwfPatients

    trigger

    GO

  5. Click Save & Close.

Configure the Hidden Components

In the first Hidden component, you'll store your Data Workflow's output. In the second, you'll store the index data. That way, you can display stored data and your new data in the same dashboard.

  1. Drag and drop two Hidden components onto your canvas, placing one after the other below your Initializer component.

  2. In the Property ID and Canvas Label Text fields for each component, enter the following:

    #

    Property ID

    Canvas Label Text

    1

    patients

    patients

    2

    vgIndex

    vgIndex

  3. Set Store Data in Database to (ON) for both hidden components.

  4. Click Save for each Hidden component as you add it.

Configure the ViewGrid Component

Next, let's add a ViewGrid component so your end-user can view the patient information.

  1. Drag and drop a ViewGrid component onto the canvas, placing it below your Data Table component.

  2. In the Label field, enter Patients.

  3. In the Property Name field, enter gridPatients.

  4. In the Action field, enter null.

  5. In the Inputs table, enter the following:

    id

    Required

    patients

    Not required

  6. In the Outputs table, enter the following:

    id

    Mapping

    vgIndex

    index

  7. In the Display table, enter the following:

    id

    formula

    heading

    patientIndex

    Chart Number

    firstName

    First Name

    lastName

    Last Name

    dob

    Date of Birth

    insurance

    Insurance

  8. Click Save.

Configure the Data Workflow Component

Now, you'll set up your Data Workflow component with a Create Index operator that adds a number to each row of your table. Instead of beginning your list with the default [0], you’ll begin with [1]. So, [1] represents the first row of your data table, and subsequent numbers represent table rows from top to bottom. You'll also add a Console operator so you can view the results in the DevTools Console.

  1. Drag and drop a Data Workflow component onto your canvas, placing ti below your ViewGrid component.

  2. In the Canvas Label Text and Property ID fields, enter dwfPatients.

Configure the First Input Operator

  1. Drag and drop an Input operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Component

    dtPatients

    Required

    No

    Source

    Default

Configure the Create Index Operator

  1. Drag and drop a Create Index operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Create Index

    Label

    Patients

    Index Name

    patientIndex

    Starting Index

    1

    Keys

  3. Connect the output port (right) of the Input operator to the input port (left) of the Create Index operator.

Configure the Output Operator

  1. Drag and drop an Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    patients

    Action

    value

  3. Connect the output port (right) of the Create Index operator to the input port (left) of the Output operator.

Configure the Console Operator

  1. Drag and drop a Console operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Console

    Label

    Indexed Patients

  3. Connect the output port (right) of the Create Index operator to the input port (left) of the Console operator.

  4. Click Save.

  5. Save your module.

The fully configured Data Workflow component looks like the following:

Here's how your module looks in the Module Builder:

Preview your module and open up the DevTools Console. You can see patient information from your Data Table component populate in your dashboard. In the DevTools Console, you can see the index numbers associated with each row of data.