# CSV_UPDATE

The CSV_UPDATE Output Component updates the value of the matched items in a file.

Once all the occurrences are updated, it will output the new value to the Keyboard Emulation and to the CSV output.

In addition, the value will be accessible from the other components through the csv_update variable.

# Parameters

Parameter name Description
Skip Output If enabled, the CSV_UPDATE output won't affect the Keyboard Emulation and the CSV output.
Search value The text or number to search for inside the CSV file.

Available variables (lowercase):
  • barcode
  • barcodes
  • number
  • text
  • timestamp
  • date_time
  • scan_session_name
  • device_name
  • select_option
  • http
  • run
  • csv_lookup
  • csv_update
  • javascript_function
Example of a possible Search value: {{ barcode }}
New Value The text or number to use to replace the Search value in the CSV file.

Available variables (lowercase):
  • barcode
  • barcodes
  • number
  • text
  • timestamp
  • date_time
  • scan_session_name
  • device_name
  • select_option
  • http
  • run
  • csv_lookup
  • csv_update
  • javascript_function
Example of a possible Search value: {{ number }}
CSV Input file path The absolute file path of the CSV file to edit.

Example for Windows: C:\Users\John\Desktop\db.csv
Example for macOS or Linux: /Users/John/Desktop/db.csv
Search Column Index The column number (starting from 1 for the left-most column of the CSV file) that contains the values where you want to search.
Column to Edit Index The column number (starting from 1 for the left-most column of the CSV file) that you want to update.
Row to Edit Rule to apply to determine the rows to change.
Not Found value The text to output when no items are affected from the update operation.

# Output

The output corresponds to the New Value field value.

If no occurrence is found the Not Found value is used as output

# Example

Suppose that this is the file you’re working with, and you want to update the second column to shipped when a barcode is scanned:

barcode,status
12345,pending
12346,pending
12347,pending
12348,pending

# Step 1 – Add the CSV_UPDATE component

Open the server settings, and drag & drop the CSV_UPDATE from the Available components filed to the Output template field, like this:

# Step 2 – Configure the CSV_UPDATE component

To edit the CSV_UPDATE parameters click on it, and:

  1. Set the New Value field to shipped
  2. Set the CSV Input File Path field to the file path you’re using as database
  3. It should look like this:

# Step 3 – Save & Apply

At this point, everything is good to go. You can click Save & Apply in the server settings, and scan from the smartphone by tapping the red camera button.

In this example, when you scan the 12347 barcode, the file will be automatically edited as follows:

barcode,status
12345,pending
12346,pending
12347,shipped  <----
12348,pending