Skip to main content

Add Record Relation

This node creates a relationship between two records.

The Add Record Relation node links two database entries, typically for many-to-many or one-to-many relationships.

The Add Record Relation node adds a reference to a target record into a relation column of a source record. For example, adding a "User" to a "Group's" members relation.

Inputs

General

DataDescription
ClassThe collection of the source record.
Record IdThe ID of the source record (the one that has the relation column).
Relation PropertyThe name of the relation column (e.g., "members", "likedBy").
Target Record IdThe ID of the record to add to the relation.

Actions

SignalDescription
DoTriggers the operation.

Outputs

Events

SignalDescription
SuccessTriggered when the relation is added.
FailureTriggered if the operation fails.

Usage

Liking a Post

  1. Class: "Posts".
  2. Record Id: The ID of the post being liked.
  3. Relation Property: "likes" (a relation to Users).
  4. Target Record Id: The current user's ID.
  5. Trigger Do.

Detailed Behavior

  • Backend: Sends a request to add the pointer/relation.
  • Updates: The source record is updated locally to reflect the new relation count or state.

Troubleshooting

  • Invalid Property: Ensure Relation Property matches the column name in the database schema exactly.