Skip to main content

Compare Object block

Use the Compare Object block to compare two objects. The output will be either the key/values that are identical in both objects or the key/values that are different in both objects:

Example:

The Compare Object block in use.

an automation consisting of a Start block, two Get Contact By Id blocks, and a Compare Object block. The Compare Object block is selected. Its two Object fields are filled in by the Get Contact By Id blocks.

Make sure to reference an actual object for each input, not just one field. Example in raw view:

The Compare Object block, with raw code.

As above, but the Object fields contain raw code.

Under Settings you can configure whether this block should output the key/values that are identical or the key/values that are different or missing in either object:

The Compare Object block's Settings tab.

The Compare Object block's Settings tab. Contains three fields: Output Mode, which is set to Return Key/values that are different in both objects; Ignore keys in Object 1 that are missing in Object 2; and Ignore keys in Object 2 that are missing in Object 1.

The Compare Object block's Settings tab.

As above, but the Settings tab contains only the Output Mode field, which is set to Return Key/values that are the same in both objects.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!