Below is a table from a document with columns Product, Quantity, Unit price, Amount. Above the table, you have a flat field (one instance) "Ship_date". Let's say you want to add "Ship_date" as a new column in your table, against each item.
Here is how you can do this with a Data action in your workflow.
First, create a new column you want to add to add to your Table. Follow the steps below to do this:
- Open your model
- Go to the Manage Labels page under AI Training on the left navigation bar
- Click on the Table headers tab on top of the Manage Labels page
- Click on Add new table header
- Type in the name for the new column. Eg: Ship_date_column
Please note: This column is separate from the flat field from which the value for this column will be picked.
Once you've added the new column name, set up the data action to pick the value for this column from the flat field. Follow the steps below to do this:
- Navigate to the Workflows section via the side navigation bar > Data actions section
- Click on Add a new step. A modal with data action options will appear
- Find and add the Add/Replace value block. The block will be added to your workflow.
- Under Apply to field, select the option Replace value in existing field. Then select the new column you just added (eg: Ship_date_column). Ensure it has the table icon next to the field name
- Under Text value, select the flat field whose value should be shown in the new table column. Eg: Ship_date
- Click on Done
To quickly test if the set up works, open the Test this action section on your workflow. Select a file to test with. You should see the <Ship_date> (flat field) value under Input and the same value under <Ship_date_column> (table column) under output.