Search Knowledge Base by Keyword

Update Column Value on Data Record

< Back

The Update Column Value on Data Record action button updates the column value of a data type when clicked. Options can be configured to show or hide the confirmation modal. The configuration information is outlined below.

Front-End (HTML)

  1. The HTML in this example is being used to render a confirmation modal (dialog) before the data records are updated. It is a fail-safe to prevent users from accidentally highlighting a row in the report and clicking the action button without confirmation.
    1. The confirmation modal can be turned on or off with a JS variable (confirmation_modal)
  2. There are a number of colors that can be utilized for the confirmation modal. To change the default blue color in the example, update the CSS class definition on Line 1. You can also remove the color specific CSS class to get a generic white modal.

    1. Available colors:
      1. modal-primary – Blue
      2. modal-info – Light Blue
      3. modal-success – Green
      4. modal-warning – Amber
      5. modal-danger – Red
  3. If using more than one action button on a report, you will need to make sure the id on Line 1 of the modal div is unique for each modal. In this example, we are using value_change_modal for the id. This is also defined again as a variable on Line 2 in the JS.
  4. Update the modal-title on Line 7 to the desired text to display for the title of the confirmation modal

Front-End (JS)

  1. The JS client-side code is being used to interact with the HTML DOM. It has standard code to render the action button on a report, and provide controls and event listeners for the action button.
  2. Toggle the confirmation_modal variable on Line 1 to true to show the confirmation modal, or false to bypass the confirmation modal
  3. If changing the modal id from HTML in the step above, then you will need to make sure the same modal id is defined in the modal_id JS variable on Line 2
  4. Update the action button title text on Line 24 to display the desired text when an end user hovers over the action button on a report
  5. Update the CSS icon used by the action button on Line 24. For a complete list of available Icon Class names, visit the Icon Library tab.

Backend (PHP)

  1. Backend server-side processing is handled inside of this PHP space. A few pre-defined variables need to be updated to account for the Data Type Id, column name, and new value.
  2. Update the $atype_id variable on Line 24 to the Data Type Id of the data type being updated
  3. Update the $column_name_change variable on Line 25 to the column name of the column being updated inside of the Data Type Id defined in the previous step
  4. Update Line 26 to the value that you are assigning to the column in the previous step. For lookup and alias columns, the format of the value is DataTypeId__RecordId where the DataTypeId is referencing lookup/alias list Data Type Id, and the number after the __ is the Record Id of the lookup value. For non-lookup columns, the actual value can be set to this variable (e.g., YES).
  5. For the values provided in the example:
    1. The action button is being used to update the Server data type with an Data Type Id of 29
    2. The lu__state lookup column on the Server data type is being updated
    3. The State data type has an Data Type Id of 3
    4. The Decommissioned list item inside of the State data type has a Record Id of 9. This is how the new column value is set to 3__9.

General Information

  1. Click the  button to choose if the action button supports selection of single or multiple datatable rows. The code inside the action button supports both approaches. If Single Select is selected, then only one record at a time can be updated. If Multi Select is selected, the user can select more than one row to update in bulk.
  2. Click the button to bring op the Button Properties dialog to assign the action button to a report or data type
    1. Configure the button properties and then click the Update button. Click the Close button to cancel the operation.

      1. Name – Name of the action button (required)
      2. Status – Choose if the action button is enabled (required)
      3. Apply to Reports – Select reports to apply the action button to
        NOTE: Action buttons can also be assigned to reports in the Report Builder.
      4. Apply to Data Types – Select data types to apply the action button to
  3. Click the  button to save the action button