Source: https://vaultcrmhelp.veeva.com/doc/Content/CRM_topics/Multichannel/CLMDocModel/CreatingContent/QueryData.htm

## Querying Documents and Records from CLM

* Document Model

Content creators can query documents and records from CLM content using the Document Model, enabling users to display CLM content personalized to the HCP. By displaying personalized content, users can improve HCP engagement and achieve greater impact with target accounts.

**Who can use this feature?**

* Business Admin Users - Browser
* Content Creator Users - Browser
* [Querying Documents and Records](#Query)
* End Users - iPad, iPhone
* Users do not require an additional license

### Configuring Attachment Fields for Querying for

[![Closed](../../../../../Skins/Default/Stylesheets/Images/transparent.gif)Business Admin Users](#)

To configure this feature:

1. Navigate to **Admin > Configuration > Objects > VMobile Object Configuration > Layouts**.
2. Place the **Include Attachment Field List (include\_attachment\_field\_list\_\_v)** field on the appropriate layouts.
3. Navigate to **Admin > Users & Groups > Permission Sets**.
4. Select the appropriate permission set.
5. Select the **Objects** tab.
6. Grant the following permissions:

   | Objects | Object Permissions | Object Types | Fields | Field Permission |
   | --- | --- | --- | --- | --- |
   | vmobile\_object\_configuration\_\_v | R | tablet\_\_v | include\_attachment\_field\_list\_\_v | Read |

[![Closed](../../../../../Skins/Default/Stylesheets/Images/transparent.gif)End Users](#)

To configure this feature:

1. Navigate to **Admin > Users & Groups > Permission Sets**.
2. Select the appropriate permission set.
3. Select the **Objects** tab.
4. Grant the following permissions:

   | Objects | Object Permissions | Object Types | Fields | Field Permission |
   | --- | --- | --- | --- | --- |
   | vmobile\_object\_configuration\_\_v | R | tablet\_\_v | include\_attachment\_field\_list\_\_v | Read |
5. Navigate to **Business Admin > Objects > VMobile Object Configurations**.
6. Navigate to the VMOC for the applicable object.
7. Define the attachment fields in the **include\_attachment\_field\_list\_\_v** field. This is a double semi-colon delimited list. This ensures specific attachment fields sync to end user devices.
8. Ensure the VMOC is **Active**.

### Querying Documents and Records as

[![Closed](../../../../../Skins/Default/Stylesheets/Images/transparent.gif)Content Creator Users](#)

To query data from the Vault CRM database and use it in CLM content, content creators can use the following JavaScript methods:

* [getDataForCurrentObject](https://developer.veevacrm.com/doc/Content/CRM_topics/Vault/clm-vault.htm#getDataForCurrentObjectobjectfieldcallback)
* [getDataForObject](https://developer.veevacrm.com/doc/Content/CRM_topics/Vault/clm-vault.htm#getDataForObjectobjectrecordfieldcallback)
* [queryRecord](https://developer.veevacrm.com/doc/Content/CRM_topics/Vault/clm-vault.htm#queryRecordobjectfieldswheresortlimitcallback)

The queryRecord JavaScript function supports attachment fields, allowing content creators to retrieve .txt files from Vault CRM. The .txt files can have a maximum size of 1.2 MB. Custom attachment fields are not supported on the user\_\_sys object.

All components of the Document Model can be queried using these methods, including [documents](https://developer.veevavault.com/vql/#documents), [Binders](https://developer.veevavault.com/vql/#binders), and [relationships](https://developer.veevavault.com/vql/#document-relationships).

Possible uses of these include:

* Displaying the HCP’s name and specialty
* Displaying the HCP’s parent organization name
* Changing the information displayed on the content based on the physician's segment
* Reading which survey is associated to the presentation being displayed

### Related Topics

[Supporting Backwards Compatibility for HTML Content](TargetPlatform.htm)

[Customizing Slide Navigation for HTML Content](CustomSlideNav.htm)

[Supported Media Types for CLM Content](SupportCustom.htm)
