If an event form has an Embedded event in it, you can use the Embedded event summary field to extract a value from the Embedded event. This is useful when you want to perform calculations using data from the records that are associated with the current record.
For example, the illness event form in the screenshot above contains an Embedded event for prescribed medications. Each medication that is prescribed as a result of a specific illness incident is entered into a medication form via the relevant illness record.
To show the most recently prescribed medication for each illness instance, an Embedded event summary field extracts the medication name from the embedded event. The advanced field property Concatenate allows you to choose whether to include only the most recent embedded event or whether to concatenate the values from all of the embedded events.
Embedded event summary fields permit values from future-dated records to be pulled into the form, where as Linked text calculations would only pull through the value from records dated prior to the date of the current record.
If a new medication is prescribed for the illness, the Embedded event summary field value will be updated automatically, without needing to resave the record.
The Embedded event must have the advanced property called Show date column set to Yes for the Embedded event summary field to work.
Steps to build an embedded event summary field
- Log in to the builder interface.
- Select the Event forms tool.
- Choose an event form that contains an Embedded event.
- Add an Embedded Event Summary field from the calculations menu.
- Name the field.
- Use the Calculation tab to enter the name of the field within the Embedded event that you want to summarize. Note that the field name must be entered here exactly how it’s written in the event form that’s embedded.
- Save the event form.
- Test this form on the main interface. Remember that you’ll need to have data permissions for the event form you’ve embedded as well as the form you’ve just added the Embedded event summary field to.