Skip to main content

Save Derived Field

Allows you to update the data of any derived field via a workflow event.

In the example below, we have added a derived field to add data of two number fields. Then created and applied an event workflow to update the result of derived field by editing the data of two fields.


Configuration - Derived Field & Event

Start by adding a derived field and creating required events.

1. Open the Collection Settings

Go to the Collection panel and click on the settings icon of the collection in which you want to add a derived field.

DrapCode Builder Save Derived Field

2. Go to Derived Fields

On the collection settings page, go to derived fields tab.

DrapCode Builder Save Derived Field

3. Create a Derived Field

Name the derived field and select any type of derived field you want. In the example below, we have picked Addition as type of derived field.

DrapCode Builder Save Derived Field

As you click the create button, a derived field will be created as shown below:

DrapCode Builder Save Derived Field

4. Create an Update Data Event

Go to the Events panel and create an update data event located under Collections category.

DrapCode Builder Save Derived Field

Data Table & Collection

Now design required pages that will contain a data table and a collection form respectively.

Page 1: Displayed Data

1. Add a Data Table

Go to the components panel and drag-and-drop the data table component. Bind the same collection in which you have created a derived field.

DrapCode Builder Save Derived Field

2. Add a Table Cell

Click the duplicate icon of an existing table cell to add another table cell as shown below.

DrapCode Builder Save Derived Field

3. Bind Derived Field

Open the settings of the duplicated table cell and bind the derived field to it in "Select Column Field".

As per the example, it will display the added value of the first two fields.

DrapCode Builder Save Derived Field

4. Open Edit Button Settings

As per the workflow, you are supposed to land on the update data page by clicking the Edit button. So, open the settings of the edit button.

DrapCode Builder Save Derived Field

5. Bind Page URL to Button

After opening the settings, bind the Update Data page to it. Then, select Parent Component Collection as Get Path Link ID. Also, add id as Path Field.

DrapCode Builder Save Derived Field

Page 2: Update Data

After clicking the edit button you will be redirected to this page.

6. Bind Collection to a Collection Form

Drop a collection form and open its settings. Then, bind the collection in which you've added a derived field to it.

DrapCode Builder Save Derived Field

7. Bind the Event

After binding the collection, bind the Update Event to it so that after making the changes in an entry you can update the changed data in the collection.

DrapCode Builder Save Derived Field

8. Bind Collection to the Page

To complete the workflow, bind the collection to the page as well. So go to the pages panel and open the settings of the page containing the collection form. Go to the Settings tab and bind the collection to the page.

DrapCode Builder Save Derived Field

Publish or Preview

Save the changes and open the page containing data table in the preview or pubish mode.

1. Click on Edit Button

Click on the edit button of the entry you want to edit and update. You will be redirected to the second page that contains the collection form.

DrapCode Builder Save Derived Field

2. Update Data

Make the required changes in the collection form and click the Submit button. You will be notified if data is successfully submitted.

DrapCode Builder Save Derived Field

3. Data in Derived Field is Updated!

Open the data table page again and you will be see that data in the derived field is updated as well.

DrapCode Builder Save Derived Field