0

Query relationships between documents in VQL

In VQL, is it possible to query related documents (copy/based on, supporting document, target of change...)?

4 comments

  • Avatar
    Adam McMillan

    Hey Raphael,

    Yes it is! For example, imagine I had a document that's a copy of another document (so it has a Based On relationship from the copy to the parent document), and I want to get the value from the Expiration Date field from the parent:

    https://{{env}}/api/v18.3//query?q=SELECT target__vr.expiration_date__c FROM relationships WHERE relationship_type__v CONTAINS ('basedon__v')

  • Avatar
    Raphael Goubet

    Yes, that's what I was looking for, thank you!

  • Avatar
    Mithun Kumar Soni

    Hi Adam,

    Is there any way to get the details like where the document has been used by making a copy (i..e Where Used details) of it using VQL?

    Thanks,

    Mithun

     

  • Avatar
    Adam McMillan

    Hey Mithun, just seeing if I understand your question:

    You want to query a document in VQL, and in the response see what other documents use this document (as if running a Where Used report on the document)?

Please sign in to leave a comment.