Budibase / budibase

Low code platform for building business apps and workflows in minutes. Supports PostgreSQL, MySQL, MariaDB, MSSQL, MongoDB, Rest API, Docker, K8s, and more 🚀
https://budibase.com
Other
22.79k stars 1.58k forks source link

Filtering on relationship fields in automations doesn't work #14883

Open ConorWebb96 opened 4 weeks ago

ConorWebb96 commented 4 weeks ago

Checklist

Hosting

Describe the bug Automation filtering doesn't work with relationship fields. No automation is ever found. If you apply the same filter to normal non relationship fields the triggers work as intended.

To Reproduce Steps to reproduce the behavior:

  1. Import the below MSSQL schema to a database
  2. Import the attached app
  3. Change your datasource settings to match your db hosting settings
  4. Fetch the tables
  5. Create a dummy campaign with the submitted status
  6. Publish the app
  7. Go to the campaigns screen
  8. Click the campaign created
  9. Change the status to done
  10. View automation history and see no trigger was fired.

Expected behavior Trigger should be fired, and automation should run.

Screenshots

Automation trigger filter

Screenshot 2024-10-28 at 08 45 41

App Export relationship filtering test-export-1730105125444.tar.gz

Table create scripts

-- Create the Status table
CREATE TABLE Status (
    StatusID INT PRIMARY KEY,                 -- Unique ID for each status
    StatusDescription NVARCHAR(100) NOT NULL  -- Description of each status
);

-- Insert predefined statuses into the Status table
INSERT INTO Status (StatusID, StatusDescription) VALUES
(0, 'Campaign: Idea Submitted'),
(1, 'Campaign: Denied'),
(2, 'Campaign: Needs Work'),
(3, 'Campaign: Approved'),
(4, 'Campaign: Archived'),
(5, 'Campaign: Idea Resubmitted');

-- Create the Campaign table with a foreign key to Status
CREATE TABLE Campaign (
    CampaignID INT PRIMARY KEY IDENTITY(1,1),  -- Unique ID for each campaign
    CampaignName NVARCHAR(100) NOT NULL,       -- Name of the campaign
    StatusID INT,                              -- Foreign key to the Status table
    CreationDate DATETIME DEFAULT GETDATE(),   -- Date when the campaign is created
    LastModifiedDate DATETIME DEFAULT GETDATE(),-- Date of last modification
    FOREIGN KEY (StatusID) REFERENCES Status(StatusID)  -- Setting up the relationship
);

Additional context The data area filtering on relationships work, this issue seems to be solely related to the automation filtering trigger.

linear[bot] commented 4 weeks ago

BUDI-8782 Apply filters to relationships in automations doesn't work