---
title: Using Event Scripts to Filter Related Data
description: A popular DreamFactory feature is the ability to pull in foreign key related records in an API call, and even create your own virtual relationships.
image: https://blog.dreamfactory.com/hubfs/Imported_Blog_Media/appimport_360.gif
---

[![DreamFactory logo](https://cdn.prod.website-files.com/64ed8da8a866be7a702fbae0/68d51994d3678214b54acb60_dreamfactory-navbar-logo.svg)](https://www.dreamfactory.com/)

 Products & Services

[AI Data Gateway](https://www.dreamfactory.com/ai-data-gateway/overview)

[Overview Why DreamFactory exists](https://www.dreamfactory.com/ai-data-gateway/overview) [Data Gov, Comp, Security Policy enforcement at the API layer](https://www.dreamfactory.com/ai-data-gateway/ai-data-governance) [Standard API Layer One contract for every backend](https://www.dreamfactory.com/ai-data-gateway/standard-api-layer) [API Gateway Functionality Routing, auth, rate limits, observability](https://www.dreamfactory.com/ai-data-gateway/api-gateway-functionality) [Deployment & Integration Self-hosted, cloud, hybrid](https://www.dreamfactory.com/ai-data-gateway/on-premise-deployment-and-integration) [Developer Productivity Auto-generated, never hand-coded](https://www.dreamfactory.com/ai-data-gateway/ai-development-accelerated) [AI App Architectures Patterns for RAG, agents, MCP](https://www.dreamfactory.com/ai-data-gateway/enterprise-ai-architectures)

AI Data Models

[AIOpenAI](https://www.dreamfactory.com/use-cases/openai) [GGoogle Gemini](https://www.dreamfactory.com/use-cases/google-gemini) [CAnthropic Claude](https://www.dreamfactory.com/use-cases/anthropic-claude-landing) [LMeta Llama](https://www.dreamfactory.com/use-cases/meta-llama) [MMistral AI](https://www.dreamfactory.com/use-cases/mistral) [CoCohere](https://www.dreamfactory.com/use-cases/cohere)

Services and support

[Quickstart Service Packages Expert-led Quickstarts to production](https://www.dreamfactory.com/services-and-support/quickstart-services-packages)

API Management

[Generate & Manage REST APIs From any database, in seconds](https://www.dreamfactory.com/api-management/generate-rest-apis) [Features Security, scripting, self-hosted & more](https://www.dreamfactory.com/api-management/features) [API Generation The complete guide to auto-generated APIs](https://blog.dreamfactory.com/a-complete-guide-to-api-generation) [API Management Concepts, tools, and best practises](https://blog.dreamfactory.com/what-is-api-management-a-brief-overview-of-api-management-concepts-and-tools?_gl=1*jl0njh*_gcl_au*MjQzMjgwMTc3LjE3ODIzMjI3MzY)

 Use Cases

AI Use Cases

[AI Data Access Secure, governed reads for your LLMs](https://www.dreamfactory.com/use-cases/ai-data-access) [MCP Server Drop-in Model Context Protocol](https://www.dreamfactory.com/use-cases/mcp-server) [Legacy Modernization Wrap mainframes with REST](https://www.dreamfactory.com/use-cases/legacy-modernization) [Data Governance Audit every call, enforce every policy](https://www.dreamfactory.com/use-cases/data-governance)

[Customer Case Studies](https://www.dreamfactory.com/case-studies)

[Energy Modernization](https://www.dreamfactory.com/case-studies/energy-snowflake-modernization) [Government Modernization](https://www.dreamfactory.com/case-studies/government-mainframe-oracle-modernization) [Government Business Intelligence](https://www.dreamfactory.com/case-studies/government-sql-server-bi-analyst-queries) [Manufacturing Modernization](https://www.dreamfactory.com/case-studies/steel-manufacturing-sap-erp-modernization) [Financial Services Investor Portal](https://www.dreamfactory.com/case-studies/financial-services-sql-server-investor-portal) [Non-Profit Partner Data Sharing](https://www.dreamfactory.com/case-studies/non-profit-sql-server-partner-data-sharing) [Professional Services Exec Dashboards](https://www.dreamfactory.com/case-studies/professional-services-erp-dashboards) [Education HR and External Data Sharing](https://www.dreamfactory.com/case-studies/education-student-hr-sql-server-mysql-external-data-sharing)

 Industries

Industries

#### [Healthcare HIPAA-grade APIs across EHR, claims, and labs.](https://www.dreamfactory.com/use-cases/healthcare)

#### [Financial Services Portfolios, partners, and portals on one layer.](https://www.dreamfactory.com/use-cases/financial-services)

#### [Government Modernize mainframes without re-platforming.](https://www.dreamfactory.com/use-cases/government)

#### [Manufacturing SAP, MES, and shop-floor data, governed.](https://www.dreamfactory.com/use-cases/manufacturing)

#### [Spotlight How enterprises run on DreamFactory From healthcare to energy to finance — governance baked into every endpoint. Browse case studies →](https://www.dreamfactory.com/case-studies)

 Connectors

SQL Database

[SQL SQL Server](https://www.dreamfactory.com/connectors/sql-server) [OR Oracle](https://www.dreamfactory.com/connectors/oracle) [PG PostgreSQL](https://www.dreamfactory.com/connectors/postgresql) [My MySQL](https://www.dreamfactory.com/connectors/mysql)

NoSQL & Docs

[Dy DynamoDB](https://www.dreamfactory.com/connectors/dynamodb) [Do DocumentDB](https://www.dreamfactory.com/connectors/azure-documentdb) [Mo MongoDB](https://www.dreamfactory.com/connectors/mongodb) [Cb CouchDB](https://www.dreamfactory.com/connectors/couch-db)

Cloud Warehouses

[S3 S3](https://www.dreamfactory.com/connectors/amazon-s3) [Ab Azureblob](https://www.dreamfactory.com/connectors/azure-blob) [FS FTP/SFTP](https://www.dreamfactory.com/connectors/ftp-sftp) [LS Local Storage](https://www.dreamfactory.com/connectors/local-storage)

C & SaaS

[Sf Salesforce](https://www.dreamfactory.com/connectors/salesforce) [API REST / SOAP](https://www.dreamfactory.com/connectors/soap-to-rest)

[See all 30+ connectors](https://www.dreamfactory.com/connectors)

[Blog](https://blog.dreamfactory.com/)

[FREE 30 Minute Demo](https://www.dreamfactory.com/demo)

[![DreamFactory logo](https://cdn.prod.website-files.com/64ed8da8a866be7a702fbae0/68d51994d3678214b54acb60_dreamfactory-navbar-logo.svg)](https://www.dreamfactory.com/)

![hamburger](https://blog.dreamfactory.com/hubfs/raw_assets/public/dreamfactory/images/megamenu/menu-hamburger.svg) ![close](https://blog.dreamfactory.com/hubfs/raw_assets/public/dreamfactory/images/megamenu/close-menu.svg)

 Back to main menu

 Products & Services

 Use Cases

 Industries

 Connectors

[Blog](https://blog.dreamfactory.com/)

[FREE 30 Minute Demo](https://www.dreamfactory.com/demo)

[AI Data Gateway](https://www.dreamfactory.com/ai-data-gateway/overview)

[Overview Why DreamFactory exists](https://www.dreamfactory.com/ai-data-gateway/overview) [Data Gov, Comp, Security Policy enforcement at the API layer](https://www.dreamfactory.com/ai-data-gateway/ai-data-governance) [Standard API Layer One contract for every backend](https://www.dreamfactory.com/ai-data-gateway/standard-api-layer) [API Gateway Functionality Routing, auth, rate limits, observability](https://www.dreamfactory.com/ai-data-gateway/api-gateway-functionality) [Deployment & Integration Self-hosted, cloud, hybrid](https://www.dreamfactory.com/ai-data-gateway/on-premise-deployment-and-integration) [Developer Productivity Auto-generated, never hand-coded](https://www.dreamfactory.com/ai-data-gateway/ai-development-accelerated) [AI App Architectures Patterns for RAG, agents, MCP](https://www.dreamfactory.com/ai-data-gateway/enterprise-ai-architectures)

AI Data Models

[AIOpenAI](https://www.dreamfactory.com/use-cases/openai) [GGoogle Gemini](https://www.dreamfactory.com/use-cases/google-gemini) [CAnthropic Claude](https://www.dreamfactory.com/use-cases/anthropic-claude-landing) [LMeta Llama](https://www.dreamfactory.com/use-cases/meta-llama) [MMistral AI](https://www.dreamfactory.com/use-cases/mistral) [CoCohere](https://www.dreamfactory.com/use-cases/cohere)

Services and support

[Quickstart Service Packages Expert-led Quickstarts to production](https://www.dreamfactory.com/services-and-support/quickstart-services-packages)

AI Data Models

[Generate & Manage REST APIs From any database, in seconds](https://www.dreamfactory.com/api-management/generate-rest-apis) [Features Security, scripting, self-hosted & more](https://www.dreamfactory.com/api-management/features) [API Generation The complete guide to auto-generated APIs](https://blog.dreamfactory.com/a-complete-guide-to-api-generation) [API Management Concepts, tools, and best practises](https://blog.dreamfactory.com/what-is-api-management-a-brief-overview-of-api-management-concepts-and-tools?_gl=1*jl0njh*_gcl_au*MjQzMjgwMTc3LjE3ODIzMjI3MzY)

AI Use Cases

[AI Data Access Secure, governed reads for your LLMs](https://www.dreamfactory.com/use-cases/ai-data-access) [MCP Server Drop-in Model Context Protocol](https://www.dreamfactory.com/use-cases/mcp-server) [Legacy Modernization Wrap mainframes with REST](https://www.dreamfactory.com/use-cases/legacy-modernization) [Data Governance Audit every call, enforce every policy](https://www.dreamfactory.com/use-cases/data-governance)

[Customer Case Studies](https://www.dreamfactory.com/case-studies)

[Energy Modernization](https://www.dreamfactory.com/case-studies/energy-snowflake-modernization) [Government Modernization](https://www.dreamfactory.com/case-studies/government-mainframe-oracle-modernization) [Government Business Intelligence](https://www.dreamfactory.com/case-studies/government-sql-server-bi-analyst-queries) [Manufacturing Modernization](https://www.dreamfactory.com/case-studies/steel-manufacturing-sap-erp-modernization) [Financial Services Investor Portal](https://www.dreamfactory.com/case-studies/financial-services-sql-server-investor-portal) [Non-Profit Partner Data Sharing](https://www.dreamfactory.com/case-studies/non-profit-sql-server-partner-data-sharing) [Professional Services Exec Dashboards](https://www.dreamfactory.com/case-studies/professional-services-erp-dashboards) [Education HR and External Data Sharing](https://www.dreamfactory.com/case-studies/education-student-hr-sql-server-mysql-external-data-sharing)

Industries

#### [Healthcare HIPAA-grade APIs across EHR, claims, and labs.](https://www.dreamfactory.com/use-cases/healthcare)

#### [Financial Services Portfolios, partners, and portals on one layer.](https://www.dreamfactory.com/use-cases/financial-services)

#### [Government Modernize mainframes without re-platforming.](https://www.dreamfactory.com/use-cases/government)

#### [Manufacturing SAP, MES, and shop-floor data, governed.](https://www.dreamfactory.com/use-cases/manufacturing)

SQL Database

[SQL SQL Server](https://www.dreamfactory.com/connectors/sql-server) [OR Oracle](https://www.dreamfactory.com/connectors/oracle) [PG PostgreSQL](https://www.dreamfactory.com/connectors/postgresql) [My MySQL](https://www.dreamfactory.com/connectors/mysql)

NoSQL & Docs

[Dy DynamoDB](https://www.dreamfactory.com/connectors/dynamodb) [Do DocumentDB](https://www.dreamfactory.com/connectors/azure-documentdb) [Mo MongoDB](https://www.dreamfactory.com/connectors/mongodb) [Cb CouchDB](https://www.dreamfactory.com/connectors/couch-db)

Cloud Warehouses

[S3 S3](https://www.dreamfactory.com/connectors/amazon-s3) [Ab Azureblob](https://www.dreamfactory.com/connectors/azure-blob) [FS FTP/SFTP](https://www.dreamfactory.com/connectors/ftp-sftp) [LS Local Storage](https://www.dreamfactory.com/connectors/local-storage)

C & SaaS

[Sf Salesforce](https://www.dreamfactory.com/connectors/salesforce) [API REST / SOAP](https://www.dreamfactory.com/connectors/soap-to-rest)

[See all 30+ connectors](https://www.dreamfactory.com/connectors)

[![back arrow](https://blog.dreamfactory.com/hubfs/raw_assets/public/dreamfactory/images/orange-arrow.svg) Blog](https://blog.dreamfactory.com/)

# Using Event Scripts to Filter Related Data

 by Terence Bennett

![calendar icon](https://blog.dreamfactory.com/hubfs/raw_assets/public/dreamfactory/images/calendar-icon.svg) January 18, 2026

Table of contents

RECOMMENDED ARTICLES

- [A Complete Guide to API Generation](https://blog.dreamfactory.com/a-complete-guide-to-api-generation)
- [10 Best API Management Tools](https://blog.dreamfactory.com/what-is-api-management-a-brief-overview-of-api-management-concepts-and-tools)
- [Creating a Microsoft SQL Server API in Less Than 5 minutes with DreamFactory](https://blog.dreamfactory.com/creating-a-microsoft-sql-server-api-in-less-than-5-minutes-with-dreamfactory)
- [Hasura vs. DreamFactory: A Comprehensive Comparison](https://blog.dreamfactory.com/hasura-vs-dreamfactory)
- [Build A Snowflake REST API in Less Than 5 Minutes](https://blog.dreamfactory.com/generate-a-snowflake-rest-api-in-less-than-5-minutes)

One of DreamFactory's most popular features is the ability to pull in [foreign key related records](https://wiki.dreamfactory.com/DreamFactory/Features/Database/Related_Data) in an API call, and even to create your own [virtual relationships](https://wiki.dreamfactory.com/DreamFactory/Tutorials/Using_virtual_foreign_keys) between disparate data sets. This make compiling all the data you need in one place a matter of asking the API for the related items. You can use filters and ordering to select the exact records you want to display, and their related items come along for the ride. Simple. Easy.

But what if you want to take that another step further? What if you wanted to use DreamFactory's database filtering mechanism to filter the data in the related records as well?

Enter Event Scripting to save the day. In this tutorial we'll walk through writing a post-process event script in V8JS to filter our related records. If you're not up to speed on DreamFactory and server side scripting, be sure to check out the [documentation](https://wiki.dreamfactory.com/DreamFactory/Features/Scripting).

The Setup

We're going to be using sample data from the Address Book sample apps that DreamFactory provides. If you haven't already, go ahead and import one of these on the Apps tab. You won't need to actually go through the whole setup process (unless you plan to use the app later.) We just want the sample data for this project.

![appimport_360.gif](https://blog.dreamfactory.com/hubfs/Imported_Blog_Media/appimport_360.gif)

**This will import the contact data into the service called db. We will use this throughout our examples in this tutorial. If you are using a different set of data, be sure to adjust accordingly.**

The Status Quo

To get a sense of what we're working with, let's do a basic filtered and related call on this data. Do a GET on db/\_table/contact?filter=(first\_name LIKE 'Jon')&related=contact\_info\_by\_contact\_id and look at the results:

```
{
    "resource": [
		{
			"id": 1,
			"first_name": "Jon",
			"last_name": "Yang",
			"image_url": "",
			"twitter": "@jon24",
			"skype": "jon24",
			"notes": "",
			"contact_info_by_contact_id": [
				{
					"id": 1,
					"ordinal": 0,
					"contact_id": 1,
					"info_type": "home",
					"phone": "500 555-0162  ",
					"email": "jon24@Home.com",
					"address": "3761 N. 14th St",
					"city": "MEDINA",
					"state": "ND",
					"zip": "58467",
					"country": "USA"
				},
				{
					"id": 2,
					"ordinal": 0,
					"contact_id": 1,
					"info_type": "work",
					"phone": "500 555-0110  ",
					"email": "jon24@Work.com",
					"address": "2243 W St.",
					"city": "MEDINA",
					"state": "ND",
					"zip": "58467",
					"country": "USA"
				},
				{
					"id": 3,
					"ordinal": 0,
					"contact_id": 1,
					"info_type": "mobile",
					"phone": "500 555-0184  ",
					"email": "jon24@Mobile.com",
					"address": "5844 Linden Land",
					"city": "MEDINA",
					"state": "ND",
					"zip": "58467",
					"country": "USA"
				}
			]
		},
		{
			"id": 61,
			"first_name": "Jon",
			"last_name": "Zhou",
			"image_url": "",
			"twitter": "@jon28",
			"skype": "jon28",
			"notes": "",
			"contact_info_by_contact_id": [
				{
					"id": 181,
					"ordinal": 0,
					"contact_id": 61,
					"info_type": "home",
					"phone": "702-555-0144  ",
					"email": "jon28@Home.com",
					"address": "3531 Brookview Drive",
					"city": "AMES",
					"state": "IA",
					"zip": "50011",
					"country": "USA"
				},
				{
					"id": 182,
					"ordinal": 0,
					"contact_id": 61,
					"info_type": "work",
					"phone": "735-555-0197  ",
					"email": "jon28@Work.com",
					"address": "1085 Greenbelt Way",
					"city": "AMES",
					"state": "IA",
					"zip": "50011",
					"country": "USA"
				},
				{
					"id": 183,
					"ordinal": 0,
					"contact_id": 61,
					"info_type": "mobile",
					"phone": "567-555-0176  ",
					"email": "jon28@Mobile.com",
					"address": "6968 Mildred Ln.",
					"city": "AMES",
					"state": "IA",
					"zip": "50011",
					"country": "USA"
				}
			]
		}
	]
}
```

 This call queries the contact table and returns all the records with a first name of Jon. It also returns all of the records from the contact\_info table that are related. This is probably too much information for some applications. So for our related filter, let's say we only want to get work info.

The Script

We're going to create a new post-process script that runs on GET db/\_table/contact. It will be **V8JS**, and we want it to be both **active** and able to **modify the response**.

![createscript_360.gif](https://blog.dreamfactory.com/hubfs/Imported_Blog_Media/createscript_360.gif)

**Here is the script. Paste the whole thing in and save it, and then we'll walk through the parts.**

```
var relationship_name =
```

Let's look at the parts now. The first 6 lines establish the variable items we're going to be working with. We're going to specify the relationship that we're working with as well as the service name and table name that contain the related data. We're going to create a related\_filter\_name that the script will look for in the parameters, and we'll construct the endpoint for calling the related items directly.

In lines 7 and 8 we'll create our options variable for passing parameters and headers into a platform.api call, and then in line 9 we store the event request parameters in a variable called params (this is just to improve readability.)

Now the functionality.

```
if (params.hasOwnProperty('related')) {
    if (params.hasOwnProperty(related_filter_name)) {
        if (params.related.hasOwnProperty(relationship_name)) {
```

This checks to see if you included the related parameter. Then it checks to see if you included the related filter parameter name (contact\_info\_by\_contact\_id\_filter.) And lastly it checks to see if the related value was the designated value on line 1 (contact\_info\_by\_contact\_id.)

```
options.parameters.fields = related_id_field;
options.parameters.filter = params[related_filter_name];
```

 This sets fields=id and filter=\[the value of contact\_info\_by\_contact\_id\_filter\]

```
 <code>var related_result = platform.api.get(related_endpoint, null, options);</code>
```

This line makes a call to the related table asking for all of its ids. Essentially we just built a call (through variables) to db/\_table/contact\_info?fiels=id&filter=\[the value of contact\_info\_by\_contact\_id\_filter\]

The ids will be stored in the related result variable.

```
var data = related_result.content;
if (data.error) throw data.error.message;
if (!data.resource) throw 'No records in response';
```

 Now we're going to store the results from that API call in a new variable and check its validity. First checking to see if it has an error property, and second checking to see if it has a resource array in it (which it should if it has data.)

```
 <code>var ids = data.resource.map(function(record) {return record[related_id_field];});</code>
```

 Now we use the map function to store all the items in a single variable array called ids.

```
event.response.content.resource.forEach(function(parent_record){
    parent_record[relationship_name] = parent_record[relationship_name].filter(function(obj){
        return (ids.indexOf(obj.id) >= 0);
     });
});
```

 This is where we combine these two data sets. We loop through the original response from DreamFactory and only return the related items whose id matches a value in the ids array.

The Solution

So now we should be able to incorporate our related filter into our original API call and get back filtered results. Do a GET on db/\_table/contact?filter=(first\_name LIKE 'Jon')&related=contact\_info\_by\_contact\_id&contact\_info\_by\_contact\_id\_filter=(info\_type like 'work')

(notice we included the contact\_info\_by\_contact\_id\_filter param and asked for only work contact\_info types.

You should get this result:

```
{
    "resource": [
		{
			"id": 1,
			"first_name": "Jon",
			"last_name": "Yang",
			"image_url": "",
			"twitter": "@jon24",
			"skype": "jon24",
			"notes": "",
			"contact_info_by_contact_id": [
				{
					"id": 2,
					"ordinal": 0,
					"contact_id": 1,
					"info_type": "work",
					"phone": "500 555-0110 ",
					"email": "jon24@Work.com",
					"address": "2243 W St.",
					"city": "MEDINA",
					"state": "ND",
					"zip": "58467",
					"country": "USA"
				}
			]
		},
		{
			"id": 61,
			"first_name": "Jon",
			"last_name": "Zhou",
			"image_url": "",
			"twitter": "@jon28",
			"skype": "jon28",
			"notes": "",
			"contact_info_by_contact_id": [
				{
					"id": 182,
					"ordinal": 0,
					"contact_id": 61,
					"info_type": "work",
					"phone": "735-555-0197 ",
					"email": "jon28@Work.com",
					"address": "1085 Greenbelt Way",
					"city": "AMES",
					"state": "IA",
					"zip": "50011",
					"country": "USA"
				}
			]
		}
	]
}
```

 Congratulations! You're now ready to filter the related records in your data. You should be able to modify this and use it as you see fit in your specific context.

This script will be posted in the [example-scripts](https://github.com/dreamfactorysoftware/example-scripts) repository on GitHub. Be sure to check out the repo and contribute a script of your own!

TAGS: [Services,](https://blog.dreamfactory.com/tag/services) [JavaScript,](https://blog.dreamfactory.com/tag/javascript) [Related Records,](https://blog.dreamfactory.com/tag/related-records) [Event Scripting,](https://blog.dreamfactory.com/tag/event-scripting) [Filter,](https://blog.dreamfactory.com/tag/filter) [V8js,](https://blog.dreamfactory.com/tag/v8js) [Scripting](https://blog.dreamfactory.com/tag/scripting)

![Terence Bennett](https://blog.dreamfactory.com/hs-fs/hubfs/1624046620145.jpg?width=100&height=100&name=1624046620145.jpg)

Terence Bennett

Terence Bennett, CEO of DreamFactory, has a wealth of experience in government IT systems and Google Cloud. His impressive background includes being a former U.S. Navy Intelligence Officer and a former member of Google's Red Team. Prior to becoming CEO, he served as COO at DreamFactory Software.

 Stay Connected with   
 The Connector Newsletter!

 Subscribe to stay up-to-date with DreamFactory's latest product updates, API best practices, and tech humor in your inbox.

[![Dreamfactory Logo](https://blog.dreamfactory.com/hubfs/raw_assets/public/dreamfactory/images/megamenu/Megamenu-logo.svg)](https://www.dreamfactory.com/)

[Call Sales +1 (415) 993-5877](tel:+14159935877)

Open – Mon–Fri 9–5 PT

[FREE 30 Minute Demo](https://www.dreamfactory.com/demo)

#### Follow us

- [GitHub](https://github.com/dreamfactorysoftware/dreamfactory)
- [Facebook](https://www.facebook.com/dfsoftwareinc/)
- [X (Twitter)](https://twitter.com/dfsoftwareinc)
- [LinkedIn](https://www.linkedin.com/company/dreamfactory-software)
- [YouTube](https://www.youtube.com/c/dreamfactorysoftware)

### Features

[Features](https://www.dreamfactory.com/features) [Self hosted](https://www.dreamfactory.com/features#self) [API Generation](https://www.dreamfactory.com/features#api) [Security](https://www.dreamfactory.com/features#secure) [Customization](https://www.dreamfactory.com/features#custom) [Pricing](https://www.dreamfactory.com/pricing)

### Installers

[Linux](https://www.dreamfactory.com/features#installer) [Docker](https://www.dreamfactory.com/features#installer) [Kubernetes](https://www.dreamfactory.com/features#installer)

### API Resources

[Documentation](https://docs.dreamfactory.com/) [Case Studies](https://www.dreamfactory.com/stories) [White Papers](https://www.dreamfactory.com/resources/whitepapers) [Academy](https://www.dreamfactory.com/academy) [API Calculator](https://calculator.dreamfactory.com) [Open Source](https://github.com/dreamfactorysoftware)

### Company

[Blog](https://blog.dreamfactory.com/) [Hub](https://www.dreamfactory.com/hub) [About us](https://www.dreamfactory.com/about) [Partners](https://www.dreamfactory.com/partners) [Support](https://www.dreamfactory.com/support) [Connectors](https://www.dreamfactory.com/connectors) [Contact Us](https://www.dreamfactory.com/demo)

 © 2025 DreamFactory. All rights reserved.

[Terms of Use](https://www.dreamfactory.com/terms-of-use) [Privacy Policy](https://www.dreamfactory.com/privacy-policy) [LLMs](https://www.dreamfactory.com/llms.txt)

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Terence Bennett",
    "url" : "https://blog.dreamfactory.com/author/terencebennett"
  },
  "dateModified" : "2024-05-07T08:19:28.833Z",
  "datePublished" : "2026-01-19T00:00:00.000Z",
  "headline" : "Using Event Scripts to Filter Related Data",
  "image" : [ "https://blog.dreamfactory.com/hubfs/Imported_Blog_Media/appimport_360.gif" ],
  "mainEntityOfPage" : {
    "@id" : "https://blog.dreamfactory.com/event-scripts-filter-related-data",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://blog.dreamfactory.com/hubfs/DreamFactory%20-%20Orange%20-%20Transparent-1.png"
    }
  }
}
```