Use Case

Often times a child (or grandchild) object will need to reference the value of a parent of (grandparent) object. While formula fields can reference parent object, it can't reference grandparent object. Additionally, in merge fields for Foundry Actions, you are only permitted to reference values on the object in which the Foundry Action is being executed.


This Foundry Action copy the value from the parent objects, populate them on the children and keep the values in synch


Code 

Attached to this Doc


Usage

This function posts a mqtt message to all of the nodes underneath it and the controller. The following is an example of how to post.


{
    "object_id": String,
    "attribute_name": String
    "attribute_value": String
    "level" (optional): Array,
    "object_type_id" (optional): String
}


object_id: the Object Id of the Property you want to publish off of
attribute_name: The name of the attribute you want to publish the payload of
attribute_value The value of the attribute you want to publish
level An array of levels to publish off of. The top node of the tree is level 0, followed by level 1, 2, etc. This is only optional if object_type_id is not specified. For example, if you wanted to publish to the objects on just the children of the object you are specifying, you would put:


"level": [1]


and if you wanted to publish on the children, and the children of those children:


"level": [1, 2]


If you put a level in the array that is out of bounds, none of the messages will be published.

object_type_id The Object Type Id of the one you want to publish to in the node structure. If the object type is not a child of the parent, it will not publish to any of it. This is only optional if level is not specified.