Loading
Get Started with Communications, Media, and Energy & Utilities (CME)...
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Filter Objects and Relationships in the Graph Using JSON

          Filter Objects and Relationships in the Graph Using JSON

          Advanced users can add filters to the Relationship Graph JSON. If you add filters, then for each specified field and record type, any data that isn't specified is omitted from the graph.

          Editing the Relationship Graph JSON is the only way to filter relationship objects. The filters in the Relationship Graph Admin Config Tool and the published Relationship Graph only filter node objects.

          The following JSON code includes an object field filter, a Party Relationship field filter, and a Custom Junction relationship field filter. It also shows how to code integer, true/false, and string fields. This code filters out Contacts not in their 40s, inactive Party Relationships, and Custom Junction relationships other than Coworker and Friend.

            "filter": [
              {
                "sobject": "Contact",
                "conditions": [
                  {
                    "fieldName": "vlocity_ins__Age__c",
                    "operator": "in",
                    "value": [
                      40,
                      41,
                      42,
                      43,
                      44,
                      45,
                      46,
                      47,
                      48,
                      49
                    ]
                  }
                ]
              },
              {
                "sobject": "vlocity_ins__PartyRelationship__c",
                "conditions": [
                  {
                    "fieldName": "vlocity_ins__IsActive__c",
                    "operator": "in",
                    "value": [
                      true
                    ]
                  }
                ]
              },
              {
                "sobject": "vlocity_ins__ContactToContactRelationship__c",
                "conditions": [
                  {
                    "fieldName": "Name",
                    "operator": "in",
                    "value": [
                      "Coworker",
                      "Friend"
                    ]
                  }
                ]
              }
            ]

          You can make the following substitutions:

          • Specify a different relationship object field instead of vlocity_ins__IsActive__c.

          • Specify a different object type instead of Contact.

          • Specify a different object field instead of vlocity_ins__Age__c.

          • Specify a different namespace instead of vlocity_ins, either vlocity_cmt or vlocity_ps.

          You can also add more objects, more record types, and more fields.

          To add filters to the Relationship Graph JSON:

          1. Prepare the filter node and its data in a text file.

            You can use a JSON Editor to ensure that your formatting is valid.

          2. Copy the filter node and its data.
          3. In the Relationship Graph Admin Config tool, click Edit JSON.
          4. Scroll to the bottom of the Graph Configuration JSON window.

            The last lines of code look like this:

                  }
                }
              }
            }
          5. Add a comma and a blank line after the second-to-last curly brace:
                  }
                }
              },
            
            }
          6. Place the cursor at the blank line, and paste the filter node and its data.
          7. Click Save.

            If Save is grayed out, it means your JSON is not correctly formatted.

           
          Loading
          Salesforce Help | Article