---
title: "Optional features for dynamic shares and bulk shares"
canonical: "https://docs.perspectium.com/space/Lithium/2326806/Optional+features+for+dynamic+shares+and+bulk+shares"
format: markdown
---
> Macro (anchor)



Once you <span style="color: #172b4d">have </span>[installed and configured DataSync for ServiceNow](https://docs-perspectium.atlassian.net/wiki/display/iodine/Install+and+Configure+DataSync+for+ServiceNow)<span style="color: #172b4d">, and have become familiar with creating </span><span style="color: #172b4d">[dynamic shares](https://docs-perspectium.atlassian.net/wiki/display/iodine/Dynamic+Share)</span><span style="color: #172b4d"> and </span><span style="color: #172b4d">[bulk shares](https://docs-perspectium.atlassian.net/wiki/display/iodine/Bulk+Share)</span><span style="color: #172b4d">, there are various optional settings that you can configure. There are </span><span style="color: #172b4d">[optional features for dynamic shares](https://docs-perspectium.atlassian.net/wiki/display/iodine/Optional+features+for+dynamic+share)</span><span style="color: #172b4d"> and </span><span style="color: #172b4d">[optional features for bulk shares](https://docs-perspectium.atlassian.net/wiki/display/iodine/Optional+features+for+bulk+share)</span><span style="color: #172b4d">, but there are also a range of features that apply to both dynamic shares and bulk shares. </span>

<span style="color: #172b4d">These optional features can help you customize your DataSync experience and leverage DataSync's robust capabilities to make your organization's integration processes more powerful and streamlined.</span>


![image](media://0ea8583c-d7ce-4e87-b237-2ad37b3c807e)

> Macro (panel)
> 
> > Macro (toc)

Explore all of these available features below!


---


# Sharing Setup

When setting up a bulk share or dynamic share, one of the settings to configure is the **Sharing setup**. This setting determines what records are sent out with the share. There are three options: **Share table records only**, **Share all table records and child records**, and **Share the last descending child of each table record**. The last option is set as the default. Scroll down a bit for a breakdown of each option. You can also read more about this setting at [Replicating ServiceNow's Parent Child Hierarchy](https://docs-perspectium.atlassian.net/wiki/display/FAQS/Replicating+ServiceNow%27s+Parent+Child+Hierarchy).

You can set this feature how you desire at the time of creating your [dynamic share](https://docs-perspectium.atlassian.net/wiki/display/iodine/Dynamic+Share) or [bulk share](https://docs-perspectium.atlassian.net/wiki/display/iodine/Bulk+Share) Here's how to change the setting:

1. <span style="color: #172b4d">In</span><span style="color: #333333"> your sharing ServiceNow instance, go to </span><span style="color: #172b4d">**Perspectium**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Perspectium Core **</span><span style="color: #333333">> </span><span style="color: #172b4d">**Shares**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Dynamic Share **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**Bulk Share **</span><span style="color: #333333">> </span><span style="color: #172b4d">**View Dynamic Shares **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**View Bulk Shares**</span><span style="color: #172b4d">.</span>
2. <span style="color: #172b4d">Find and click into the dynamic share or bulk share that you want to change the sharing setup for.</span>
3. <span style="color: #172b4d">In the resulting dynamic share or bulk share page, in the </span><span style="color: #172b4d">**General Settings **</span><span style="color: #172b4d">section, use the </span><span style="color: #172b4d">**Sharing setup **</span><span style="color: #172b4d">dropdown to select the option you want.</span>
4. <span style="color: #172b4d">Click </span><span style="color: #172b4d">**Update**</span><span style="color: #172b4d">.</span>

![image](media://5f9d3954-075d-4674-85dd-cc65dc70ee8f)

## Share table records only

This feature allows you to share only records for the table you select in your setup of a dynamic or bulk share. Otherwise, by default, shares will share records for the table you select, *as well as* the last descending associated child records for that table. So, this feature disables the sharing of those associated child records and shares the base table only. 

For more information on this, see [Replicating ServiceNow's Parent Child Hierarchy](https://docs-perspectium.atlassian.net/wiki/display/FAQS/Replicating+ServiceNow%27s+Parent+Child+Hierarchy).

> Macro (ui-expand)
> 
> ### Consider this image:
> 
> ![image](media://e270c285-d483-4e3d-b4c4-6c0bdbeaea05)
> 
> In this example, if you were to share the **cmdb_ci **table, and you enable this feature, then the subscribing instance would receive *only *the **cmdb_ci **records (the red circle), and *not* the associated **cmdb_ci_hardware**,** cmdb_ci_computer**, **cmdb_ci_server**, and **cmdb_ci_linux_server **records.

## Share all table records and child records

This feature allows you to share all child records associated with a table, in addition to the table records themselves. Otherwise, by default, shares will share records for the table you select, and the last descending associated child records for that table. So, this feature enables the sharing of *all* associated child records along with the base table. 

Please note that using this option for dynamic share may result in slowed performance in your ServiceNow instance when using business rules. 

For more information on this, see [Replicating ServiceNow's Parent Child Hierarchy](https://docs-perspectium.atlassian.net/wiki/display/FAQS/Replicating+ServiceNow%27s+Parent+Child+Hierarchy).

> Macro (ui-expand)
> 
> ### Consider this image:
> 
> ![image](media://3d33a0e0-cc74-4d2d-be6c-e49a3df4b93f)
> 
> In this example, if you were to share the **cmdb_ci **table, and you enable this feature, then the subscribing instance would receive *all* associated child records (**cmdb_ci_hardware**,** cmdb_ci_computer**, **cmdb_ci_server**, and **cmdb_ci_linux_server **records as represented by the red circles).

## Share the last descending child of each table record

This feature for dynamic shares and bulk shares allows you to share only child records that are directly associated with the chosen table, in addition to the table records themselves. This is the default option.

For more information on this, see [Replicating ServiceNow's Parent Child Hierarchy](https://docs-perspectium.atlassian.net/wiki/display/FAQS/Replicating+ServiceNow%27s+Parent+Child+Hierarchy).


> Macro (ui-expand)
> 
> ### Consider this image:
> 
> ![image](media://aacb99a8-89d0-423c-94f0-27948fbed196)
> 
> In this example, if you were to share the **cmdb_ci **table, and you enable this feature, then the subscribing instance would receive the child records that are the lowest descendants of the parent-child hierarchy (as represented by the red circles)

<u><span style="color: #000000">[↑ Go to top of page](https://docs-perspectium.atlassian.net/wiki/spaces/Lithium/pages/2326806/Optional+features+for+dynamic+shares+and+bulk+shares#Topofpage)</span></u>


---


# Conditional shares

This feature allows you to create conditional shares that can be used to share records to multiple target queues and/or using multiple [table maps](https://docs-perspectium.atlassian.net/wiki/display/iodine/ServiceNow+Table+Maps).

Conditional bulk shares will share out records that meet your specified conditions once at a specified time.

Conditional dynamic shares will share out records that meet your specified conditions as records are created, updated, and/or deleted.

> ℹ️ - When using a table map with a dynamic or bulk share (including conditional shares), the [Sharing setup](https://docs-perspectium.atlassian.net/wiki/spaces/Lithium/pages/2326806) will default to **Share the table records only**. If you were to use a Sharing setup of **Share all table records and child records** with a table map, this will cause duplicate records for a parent and its child records to be sent out since table maps will map all the records to the same target table name.
> ℹ️ - With **Share only selected fields** enabled, the **Use Table Map** option will not be available on conditional shares. Since both options modify the fields in the outgoing record payload, both options are not compatible with each other.

Here's how to create a conditional share:

1. <span style="color: #172b4d">In</span><span style="color: #333333"> your sharing ServiceNow instance, go to </span><span style="color: #172b4d">**Perspectium**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Perspectium Core **</span><span style="color: #333333">> </span><span style="color: #172b4d">**Shares**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Dynamic Share **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**Bulk Share **</span><span style="color: #333333">> </span><span style="color: #172b4d">**View Dynamic Shares **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**View Bulk Shares**</span><span style="color: #172b4d">.</span>
2. <span style="color: #172b4d">Find and click into the dynamic share or bulk share that you want to configure.</span>
3. <span style="color: #172b4d">In the resulting dynamic share or bulk share page, in the </span><span style="color: #172b4d">**Runtime Settings **</span><span style="color: #172b4d">tab, under the </span><span style="color: #172b4d">**Triggers **</span><span style="color: #172b4d">section, check the </span><span style="color: #172b4d">**Conditional share **</span><span style="color: #172b4d">box. This will reveal a </span><span style="color: #172b4d">**PSP Conditional Shares **</span><span style="color: #172b4d">tab below the </span><span style="color: #172b4d">**Related Links **</span><span style="color: #172b4d">section.</span>  
  
> Macro (inline-media-image)
4. <span style="color: #172b4d">Click the new </span><span style="color: #172b4d">**PSP Conditional Shares **</span><span style="color: #172b4d">tab, and then click </span><span style="color: #172b4d">**New**</span><span style="color: #172b4d">. </span><span style="color: #000000">If using Google Chrome, you may see a popup asking if you want to leave the site—click </span><span style="color: #172b4d">**Leave**</span><span style="color: #000000">.</span>
5. <span style="color: #000000">On the resulting page, use the </span><span style="color: #000000">**Target Queue **</span><span style="color: #000000">field and the search icon to select a target queue for the conditional shares.</span>
6. <span style="color: #000000">(Optional!) Check the </span><span style="color: #000000">**Use Table Map**</span><span style="color: #000000"> box if you want to use a table map for your conditional share, and use the search icon to find and select the table map you want to use.</span>  
  
> Macro (inline-media-image)
7. <span style="color: #000000">Now, you're ready to set conditions for the share:</span>
  1. <span style="color: #000000">Click the lock icon next to </span><span style="color: #000000">**Domain**</span><span style="color: #000000">, and then the search icon to choose a domain. </span>:info:<span style="color: #000000">** NOTE: To prevent invalid GlideRecord queries, as of Krypton 8.6.0, if the table does not have a sys_domain field, the Domain option will not be available.**</span>
  2. <span style="color: #000000">To share out all records in all child domains that match the filter conditions you create, check the </span><span style="color: #000000">**Share as Child Domain **</span><span style="color: #000000">box.</span>
  3. <span style="color: #000000">Next to </span><span style="color: #000000">**Condition**</span><span style="color: #000000">, use the </span><span style="color: #000000">**choose field **</span><span style="color: #000000">dropdown to choose a field that you want to add filter conditions to. Then, choose an operator and value for that filter. To check which operators are available for ServiceNow field types, see </span><span style="color: #000000">[operators available for filters and queries](https://docs.servicenow.com/bundle/london-platform-user-interface/page/use/common-ui-elements/reference/r_OpAvailableFiltersQueries.html)</span><span style="color: #000000">.</span>
  4. <span style="color: #000000">To add more conditions, click </span><span style="color: #000000">**Add Filter Condition**</span><span style="color: #000000"> and repeat Step 7c. To add a conditional "or" clause, click </span><span style="color: #000000">**Add "OR" Clause **</span><span style="color: #000000">instead. </span>
  5. <span style="color: #000000">(Optional!) Click </span><span style="color: #000000">**X **</span><span style="color: #000000">in line with any of the filters if you want to remove that filter.</span>
  6. <span style="color: #000000">(Optional!) Use the </span><span style="color: #000000">**Company **</span><span style="color: #000000">field to find and select a company to filter on, if you want to filter the conditional share by company.</span>
  7. <span style="color: #000000">(Optional!) Use the </span><span style="color: #000000">**Test Record **</span><span style="color: #000000">option to choose a record to test your conditional share for.</span>
8. Finally, when your conditions for the share are set, click **Submit**.
9. Back in the dynamic share of bulk share page, click **Update**. Or, if it's a bulk share, you can click **Execute Now**. Or, if it's a dynamic share, you can click **Run a Bulk Share **<span style="color: #000000">to run your conditional share as a bulk share first before dynamically sharing records based on the conditions you set.</span>


<u><span style="color: #000000">[↑ Go to top of page](https://docs-perspectium.atlassian.net/wiki/spaces/Lithium/pages/2326806/Optional+features+for+dynamic+shares+and+bulk+shares#Topofpage)</span></u>


---


# ServiceNow attachments

## Include attachments

This feature allows you to sync your ServiceNow attachments along with your dynamic share or bulk share. Here's how:

1. <span style="color: #172b4d">In</span><span style="color: #333333"> your sharing ServiceNow instance, go to </span><span style="color: #172b4d">**Perspectium**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Perspectium Core **</span><span style="color: #333333">> </span><span style="color: #172b4d">**Shares**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Dynamic Share **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**Bulk Share **</span><span style="color: #333333">> </span><span style="color: #172b4d">**View Dynamic Shares **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**View Bulk Shares**</span><span style="color: #172b4d">.</span>
2. <span style="color: #172b4d">Find and click into the dynamic share or bulk share that you want to configure.</span>
3. <span style="color: #172b4d">In the resulting dynamic share or bulk share page, in the </span><span style="color: #172b4d">**Runtime Settings **</span><span style="color: #172b4d">tab, under the </span><span style="color: #172b4d">**Additional Records **</span><span style="color: #172b4d">section, check the </span><span style="color: #172b4d">**Include attachments **</span><span style="color: #172b4d">box.</span>
4. <span style="color: #172b4d">Click </span><span style="color: #172b4d">**Update**</span><span style="color: #172b4d">. </span>


> ℹ️ **SOME NOTES:**
> ℹ️ 
> ℹ️ - <span style="color: #000000">Attachment deletes are not currently supported through the </span><span style="color: #000000">**Include attachments**</span><span style="color: #000000"> option. </span>
> ℹ️ - <span style="color: #000000">ServiceNow does not support .twb and .twbx attachment.</span>
> ℹ️ - <span style="color: #000000">If using a dynamic share, you may want to </span><span style="color: #000000">[share out previously uploaded attachments](https://docs-perspectium.atlassian.net/wiki/display/iodine/Optional+features+for+dynamic+share#Optionalfeaturesfordynamicshare-SharepreviouslyuploadedServiceNowattachments)</span><span style="color: #000000"> that were updated before your dynamic share was created.</span>
> ℹ️ - After enabling the **Include attachments** option, shared records from the **sys_attachment** and **sys_attachment_doc** tables will be put into outbound messages in the **u_psp_attachment_out_message** table before being shared out of your source instance.
> ℹ️ - You can also [share ServiceNow attachments with only specific file extensions](https://docs-perspectium.atlassian.net/wiki/display/iodine/Optional+features+for+dynamic+share#Optionalfeaturesfordynamicshare-ShareServiceNowattachmentswithspecifiedfileextensions).

## Include embedded images or videos

This feature allows you to include embedded images and videos within dynamic shares or bulk shares, so that the subscribing instance(s) to display these images/videos properly when displaying the selected table's records.

This feature is only available for tables that have **HTML **or** Translated HTML** field types that support embedded images and videos (for example, the **kb_knowledge **table). For any other field types (such as **String**), embedded images/videos will not be shared out properly. For more information on this, see [HTML field type](https://docs.servicenow.com/bundle/quebec-platform-administration/page/use/using-forms/concept/c_UseHTMLFields.html).

If the images or videos you want to embed are categorized as an **Attachment **type, then you can simply use the **Include attachments** option. Otherwise, here's how to include embedded images/videos:

1. <span style="color: #172b4d">In</span><span style="color: #333333"> your sharing ServiceNow instance, go to </span><span style="color: #172b4d">**Perspectium**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Perspectium Core **</span><span style="color: #333333">> </span><span style="color: #172b4d">**Shares**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Dynamic Share **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**Bulk Share **</span><span style="color: #333333">> </span><span style="color: #172b4d">**View Dynamic Shares **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**View Bulk Shares**</span><span style="color: #172b4d">.</span>
2. <span style="color: #172b4d">Find and click into the dynamic share or bulk share that you want to configure.</span>
3. <span style="color: #172b4d">In the resulting dynamic share or bulk share page, in the </span><span style="color: #172b4d">**Miscellaneous **</span><span style="color: #172b4d">tab, check the </span><span style="color: #172b4d">**Include embedded images/videos **</span><span style="color: #172b4d">box.</span>
4. <span style="color: #172b4d">On the subscribing ServiceNow instance, you must subscribe to the follwing tables in order for embedded images/videos to be properly synced between instances:</span>
  - <span style="color: #172b4d">**db_image**</span>
  - <span style="color: #172b4d">**db_video**</span>
  - <span style="color: #172b4d">**sys_attachment**</span>
  - <span style="color: #172b4d">**sys_attachment_do**</span>
5. <span style="color: #172b4d">Click </span><span style="color: #172b4d">**Update**</span><span style="color: #172b4d">. </span>


> ✅ <span style="color: #000000">If you are re-sharing a record that a subscribing instance previously received and is showing broken images/videos (because the first time sharing didn't properly share these embedded images/videos), you will need to clear your browser's cache after the subscribing instance receives the re-shared messages for these images/videos to properly display. ServiceNow caches embedded images/videos, even ones that were previously broken but are now fixed.</span>


<u><span style="color: #000000">[↑ Go to top of page](https://docs-perspectium.atlassian.net/wiki/spaces/Lithium/pages/2326806/Optional+features+for+dynamic+shares+and+bulk+shares#Topofpage)</span></u>


---


# ServiceNow work notes and comments

This feature allows you to include work notes and comments, referred to as **journal fields **in ServiceNow, in your dynamic shares and bulk shares. This feature requires you to [configure a ServiceNow instance as a subscriber](https://docs-perspectium.atlassian.net/wiki/display/iodine/ServiceNow+shared+and+subscribed+queues#ServiceNowsharedandsubscribedqueues-CreateaServiceNowsubscribedqueue).

Here's how:

1. <span style="color: #172b4d">In</span><span style="color: #333333"> your sharing ServiceNow instance, go to </span><span style="color: #172b4d">**Perspectium**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Perspectium Core **</span><span style="color: #333333">> </span><span style="color: #172b4d">**Shares**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Dynamic Share **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**Bulk Share **</span><span style="color: #333333">> </span><span style="color: #172b4d">**View Dynamic Shares **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**View Bulk Shares**</span><span style="color: #172b4d">.</span>
2. <span style="color: #172b4d">Find and click into the dynamic share or bulk share that you want to configure.</span>
3. <span style="color: #172b4d">In the resulting dynamic share or bulk share page, in the </span><span style="color: #172b4d">**Runtime Settings **</span><span style="color: #172b4d">tab, in the </span><span style="color: #172b4d">**Additional Records **</span><span style="color: #172b4d">section, check the </span><span style="color: #172b4d">**Include journal fields**</span><span style="color: #172b4d"> AND the </span><span style="color: #172b4d">**Include audit log **</span><span style="color: #172b4d">boxes. You must check both of these boxes in order to accurately update the history/activity log on your subscribing ServiceNow instance. For more information about how this works in ServiceNow, see </span><span style="color: #172b4d">[journal fields](https://docs.servicenow.com/bundle/quebec-platform-administration/page/administer/task-table/reference/r_JournalFields.html)</span><span style="color: #172b4d"> and </span><span style="color: #172b4d">[audit logging](https://docs.servicenow.com/bundle/quebec-platform-administration/page/administer/login/reference/r_AuditLogging.html)</span><span style="color: #172b4d">.</span>
4. <span style="color: #172b4d">(Optional!) Upon checking the </span><span style="color: #172b4d">**Include audit log **</span><span style="color: #172b4d">box, it will reveal a </span><span style="color: #172b4d">**Filter audit fields**</span><span style="color: #172b4d"> box—if you want, you can check this box in order to specify which audit log records to be shared out. This option is helpful if you want to share out only audit records that are related to specific fields on the table being setup for this share. For example, if you are setting up a dynamic share on the Computer (</span><span style="color: #172b4d">**cmdb_ci_computer**</span><span style="color: #172b4d">) table and only want to share out audit records for changes on the Name (</span><span style="color: #172b4d">**name**</span><span style="color: #172b4d">) field.</span>  
  
<span style="color: #172b4d">In order to filter the audit fields, check the </span><span style="color: #172b4d">**Filter audit fields box**</span><span style="color: #172b4d">, which will reveal a </span><span style="color: #172b4d">**Filter Audit Fields **</span><span style="color: #172b4d">tab in the table at the bottom of the page. Click </span><span style="color: #172b4d">**New **</span><span style="color: #172b4d">and in the resulting </span><span style="color: #172b4d">**Share Field **</span><span style="color: #172b4d">page, choose the field that you want to filter and share out audit records on. You can add as many fields as you wish. </span>  
  
<span style="color: #172b4d">If you have checked the </span><span style="color: #172b4d">**Filter audit fields **</span><span style="color: #172b4d">box, but don't add any specific fields, then no audit records will be shared at all. If you want to share audit records, but don't need to specify  filters, then make sure to leave that box unchecked.</span>  
  
> Macro (inline-media-image)
5. <span style="color: #172b4d">Click </span><span style="color: #172b4d">**Update**</span><span style="color: #172b4d">.</span>


> ℹ️ **SOME NOTES:**
> ℹ️ 
> ℹ️ - <span style="color: #000000">As a default, when</span><span style="color: #000000">** Include journal fields**</span><span style="color: #000000"> is selected for a dynamic share, a maximum of 100 comments and work notes records and a maximum of 200 audit log records will be dynamic shared. This limit can be adjusted by changing the system property </span><span style="color: #000000">**com.perspectium.dynamic.sys_journal_field.limit**</span><span style="color: #000000">. Bulk sharing of comments, work notes, and audit logs are not restricted by these limits.</span>
> ℹ️ - <span style="color: #000000">A new default limit of 200 is also set for dynamically sharing audit log records. This limit can be adjusted by changing the system property </span><span style="color: #000000">**com.perspectium.dynamic.sys_audit.limit**</span><span style="color: #000000">. Bulk shares are not restricted by these limits.</span>
> ℹ️ - <span style="color: #172b4d">With </span><span style="color: #000000">[DataSync Agent](https://docs-perspectium.atlassian.net/wiki/display/iodine/DataSync+Agent)</span><span style="color: #172b4d">, the </span><span style="color: #172b4d">**Include journal fields**</span><span style="color: #172b4d"> option will create the sys_journal_field table on the target database. The </span><span style="color: #172b4d">**Include audit log**</span><span style="color: #172b4d"> will also create the </span><span style="color: #222222">sys_audit_log on the target database. However, be aware that this option has the potential to contain a huge amount of data</span>

<u><span style="color: #000000">[↑ Go to top of page](https://docs-perspectium.atlassian.net/wiki/spaces/Lithium/pages/2326806/Optional+features+for+dynamic+shares+and+bulk+shares#Topofpage)</span></u>


---


# View names

This feature allows you to control the number of fields being shared out from your ServiceNow table. Otherwise, by default, dynamic shares and bulk shares will share all fields available in a table. To enable this feature, you'll want to create a form view, and then personalize it. For information on how to do this, see [personalize a form](https://docs.servicenow.com/bundle/madrid-platform-user-interface/page/use/using-forms/task/t_PersonalizeAForm.html).

Here's how to configure a share so that it shares only specific fields:

1. <span style="color: #172b4d">In</span><span style="color: #333333"> your sharing ServiceNow instance, go to </span><span style="color: #172b4d">**Perspectium**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Perspectium Core **</span><span style="color: #333333">> </span><span style="color: #172b4d">**Shares**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Dynamic Share **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**Bulk Share **</span><span style="color: #333333">> </span><span style="color: #172b4d">**View Dynamic Shares **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**View Bulk Shares**</span><span style="color: #172b4d">.</span>
2. <span style="color: #172b4d">Find and click into the dynamic share or bulk share that you want to configure.</span>
3. <span style="color: #172b4d">In the resulting dynamic share or bulk share page, in the </span><span style="color: #172b4d">**Miscellaneous **</span><span style="color: #172b4d">tab, use the </span><span style="color: #172b4d">**View name**</span><span style="color: #172b4d"> field to type your form view name.</span>
4. <span style="color: #172b4d">Click </span><span style="color: #172b4d">**Update**</span><span style="color: #172b4d">. </span>


<u><span style="color: #000000">[↑ Go to top of page](https://docs-perspectium.atlassian.net/wiki/spaces/Lithium/pages/2326806/Optional+features+for+dynamic+shares+and+bulk+shares#Topofpage)</span></u>


---


# Referenced field records

This feature allows you to share field records that are related to the base table you are dynamic or bulk sharing. For example, if you are dynamic sharing the **Incident** table, you can use this feature to share the referenced fields **Assigned To User **(**sys_user**) and **Configuration Item **(**cmdb_ci**) for each incident record. 

Here's how to enable the feature:

1. <span style="color: #172b4d">In</span><span style="color: #333333"> your sharing ServiceNow instance, go to </span><span style="color: #172b4d">**Perspectium**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Perspectium Core **</span><span style="color: #333333">> </span><span style="color: #172b4d">**Shares**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Dynamic Share **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**Bulk Share **</span><span style="color: #333333">> </span><span style="color: #172b4d">**View Dynamic Shares **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**View Bulk Shares**</span><span style="color: #172b4d">.</span>
2. <span style="color: #172b4d">Find and click into the dynamic share or bulk share that you want to configure.</span>
3. <span style="color: #172b4d">In the resulting dynamic share or bulk share page, in the </span><span style="color: #172b4d">**Runtime Settings **</span><span style="color: #172b4d">tab, check the </span><span style="color: #172b4d">**Include referenced field records **</span><span style="color: #172b4d">box. This will add a </span><span style="color: #172b4d">**Referenced Field Records **</span><span style="color: #172b4d">tab at the bottom of the page. </span>
4. <span style="color: #172b4d">Click the </span><span style="color: #172b4d">**Referenced Fields Records **</span><span style="color: #172b4d">tab, and click either </span><span style="color: #172b4d">**Add all referenced fields **</span><span style="color: #172b4d">to add all fields that are referenced by the base table you are sharing, or click </span><span style="color: #172b4d">**New**</span><span style="color: #172b4d"> if you want to manually select the specific fields.</span>
  1. <span style="color: #172b4d">If you press </span><span style="color: #172b4d">**New**</span><span style="color: #172b4d">, you'll be taken to a new form where you can manually select the </span><span style="color: #172b4d">**Field **</span><span style="color: #172b4d">you want. </span><span style="color: #000000">If using Google Chrome, you may see a popup asking if you want to leave the site—click </span><span style="color: #172b4d">**Leave**</span><span style="color: #000000">. Once you've added the Field, click </span><span style="color: #000000">**Submit**</span><span style="color: #000000">. </span><span style="color: #172b4d">Repeat Step 4a for as many fields as you want.</span>
5. Back in the dynamic share or bulk share page, click **Submit**.


<u><span style="color: #000000">[↑ Go to top of page](https://docs-perspectium.atlassian.net/wiki/spaces/Lithium/pages/2326806/Optional+features+for+dynamic+shares+and+bulk+shares#Topofpage)</span></u>


---


# Before/after share scripts

The **before share scripts** feature allows the current record being share out to be processed after it is loaded into a [GlideRecord](https://docs.servicenow.com/bundle/geneva-servicenow-platform/page/script/glide_server_apis/concept/c_GlideRecord.html), <span style="color: #000000">but before it is encrypted and queued up to the Perspectium Cloud Server. Before share scripts expect </span>server-side javascript<span style="color: #172b4d"> </span><span style="color: #000000">and is preconfigured with a globally available variable called </span><span style="color: #000000">**current**</span><span style="color: #000000">, which is the</span><span style="color: #172b4d"> </span>GlideRecord<span style="color: #172b4d"> </span><span style="color: #000000">object that is going to be shared.</span>

> ❌ <span style="color: #000000">Because before share scripts are executed every time a record is shared, be aware of the processing delays introduced that will be multiplied when sharing multiple records at the same time. Also, if you have multiple share configurations for the same table (such as different share configurations that each have a different target queue), any changes to the current object may affect any conditions you have to share since this same current object is referenced as we iterate through the table's different share configurations.</span>

<span style="color: #000000">The </span><span style="color: #000000">**after share scripts**</span><span style="color: #000000"> feature allows you to specify a script that will run after your dynamic share or bulk share has shared a record. This can be useful for when you run scripts in the before share script for your</span> dynamic/bulk<span style="color: #000000"> share that you want to then cancel out after the share has run.</span>

## Variables to use

> Macro (ui-expand)
> 
> | **Variable** | **Description** | **Accessible in Before share script** | **Accessible in After share script** |
> | --- | --- | --- | --- |
> | **psp_action** | To specify the “action” value of records being shared. The “action” is the value that appears after the table name in the “name” field of outgoing DataSync messages. For example, action is “insert” in “incident.insert” (for records being inserted), “update” in “incident.update” (records being updated) and so forth. This is useful for integrations with other systems where you want the table to designate a different action from the default one ServiceNow specifies.<br>Say you are integrating with another system and using the correlation_id to designate the incident record's number in the other system. If there was a failure creating the incident in the other system and you do an update to the incident in ServiceNow, instead of sending the record as an “update”, you may want to send it as an “insert” instead so as to create the incident in the other system this time. The following script will accomplish this by setting action to “insert” when the correlation_id field is not populated:<br>> Macro (nested-table) | :check_mark: | :check_mark: |
> | **share_gr** | To access the bulk and dynamic share records themselves from the **Before Share Script**.<br>For example, the following will log the value of the current bulk/dynamic share record's system id:<br>> Macro (nested-table) | :check_mark: | :cross_mark: |
> | **previous** | To access the previous record in a dynamic or bulk share (ie, a record before it has been modified).<br>For example, the following script will log the value of the previous record’s short description:<br>> Macro (nested-table)<br>:info: <u>**NOTE**</u>: You can only access the *previous* variable when the **Business Rule When** is set to **before** or **after **under **Trigger Conditions** of the dynamic. In addition, the information above only applies to dynamic shares; the data shared in a bulk share is historical and will not have been modified. | :check_mark: | :check_mark: |
> | **psp_key** | To access the key value of the outbound message, you can change the **psp_key** global dynamically.<br>To enable, turn off **com.perspectium.validate_mismatch_key** in your Perspectium properties.<br>> Macro (nested-table) | :check_mark: | :cross_mark: |
> | **psp_name** | By default, the **name** field in the outbound message consist of the table name followed by the action, i.e. incident.insert. With **psp_name**, you can change the table name in the **name** field before the outbound message is sent.<br>> Macro (nested-table)<br>This global variable is helpful for cases like sharing archived records as deleted records from the original table to delete records in a database. See below steps:   
> 1<br>Create bulk share on an archived table  
> 2<br>Set **Before share script** as:<br>> Macro (nested-table)<br>3<br>Check **Share only selected fields** and add **sys_id** in the **Share Fields** related list.<br>:warning: <u>**WARNING**</u>: <span style="color: #172b4d">This is </span><span style="color: #172b4d">**NOT**</span><span style="color: #172b4d"> recommended to change when sharing records from a table for the first time/creating a new table in the database.</span><br>:info: <u>**NOTE**</u>: If you are using custom schema, the value set in **psp_name** will get edited to have the custom schema’s table prefix/suffix:<br>- This is intended to be used with DataSync Agent only
> - Must be a valid table name | :check_mark: | :cross_mark: |
> | **ignore** | To prevent the current record from being shared in a dynamic or bulk share, you can set the variable **ignore** to **true **in the **Before share script**.<br>For example, the following script ignores the dynamic sharing of an *incident* record when the *priority* field value is **1**:<br>> Macro (nested-table) | :check_mark: | :cross_mark: |

## Create before or after share scripts

Here's how to create before and/or after share scripts:

1. <span style="color: #172b4d">In</span><span style="color: #333333"> your sharing ServiceNow instance, go to </span><span style="color: #172b4d">**Perspectium**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Perspectium Core **</span><span style="color: #333333">> </span><span style="color: #172b4d">**Shares**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Dynamic Share **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**Bulk Share **</span><span style="color: #333333">> </span><span style="color: #172b4d">**View Dynamic Shares **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**View Bulk Shares**</span><span style="color: #172b4d">.</span>
2. <span style="color: #172b4d">Find and click into the dynamic share or bulk share that you want to configure.</span>
3. <span style="color: #172b4d">In the resulting dynamic share or bulk share page, click the </span><span style="color: #172b4d">**Scripting **</span><span style="color: #172b4d">tab.</span>
4. Type your before and/or after share script in the appropriate field. For some scripting examples, see the next section.
5. Click **Update**.

## Examples of before and after scripts to use

> Macro (ui-expand)
> 
> For cases where you have a table's records updated frequently but data doesn't actually change (such as a table that gets updated every single day via another integration or ServiceNow Discovery), you may not want the table's dynamic share (with **interactive only** not selected) to run and share out any records.
> 
> For example, say the field that gets updated every day is u_last_discovered_date. The rest of the fields don't usually change, and you don't want to share these records out again since the subscribing side (such as a database) doesn't really need the latest u_last_discovered_date.
> 
> In these cases, you can run the following script to ignore sharing the record:
> 
> ```
> function listChangedFields(obj){
> 	var flds = [];
> 	var aud = new GlideRecord("sys_audit");
> 	aud.addQuery("documentkey", obj.sys_id);
> 	aud.addQuery("record_checkpoint", obj.sys_mod_count);
> 	aud.query();
> 	while (aud.next()){
> 		flds.push(aud.getValue("fieldname"));
> 	}
> 	return flds;
> }
> 
> var changedFields = listChangedFields(current);
> var ignoreFields = ["priority", "urgency"]; // If any changed field falls outside that list, the update will be sent
> 
> ignore = true;
> 
> var util = new ArrayUtil();
> for (var i=0; i<changedFields.length; i++){
> 	if (!util.contains(ignoreFields, changedFields[i])) ignore = false;
> }
> ```

> Macro (ui-expand)
> 
> The **Before** **bulk share script** section also allows you to cancel a bulk share from running if your script contains:
> 
> ```java
> cancel = true;
> ```
> 
> That is, if after evaluating the script, there is a **cancel** variable and its value is set equal to **true**, then the bulk share will cancel from running.
> 
> This may be useful for when you only want the bulk share to run if certain conditions are met and you prefer to create/check for these conditions using server side javascript instead of the condition builder.

> Macro (ui-expand)
> 
> Use the **Before and After share script** sections together to specify a [language](http://wiki.servicenow.com/index.php?title=Language_Internationalization#gsc.tab=0) to share out records in.
> 
> In the **Before share script**, you would have the following script so all records shared out will have English translated text (for fields that support translation as mentioned in the language link above):
> 
> ```
> var lang = gs.getSession().getLanguage(); 
> var gc = (typeof GlideController != 'undefined') ? GlideController : Packages.com.glide.script.GlideController;
> gc.putGlobal('user_lang', lang);
> gs.getSession().setLanguage("en");
> ```
> 
> <span style="color: #333333">In the </span><span style="color: #333333">**After share script**</span><span style="color: #333333">, you would cancel this change so it doesn't affect users who are using the system and want to see translations in their selected language:</span>
> 
> ```
> var gc = (typeof GlideController != 'undefined') ? GlideController : Packages.com.glide.script.GlideController;
> var userlang = gc.getGlobal('user_lang');
> gs.getSession().setLanguage(userlang);
> ```

> Macro (ui-expand)
> 
> <span style="color: #000000">W</span><span style="color: #333333">hen you have a ticket bulk share where you want to use the </span><span style="color: #000000">Share only Sys IDs listed</span><span style="color: #333333"> feature and want to populate the sys id related list with sys ids of tickets that meet a query condition such as a state of open, you can write a script using the </span><span style="color: #000000">PerspectiumBulkShare API</span><span style="color: #333333"> in the </span><span style="color: #333333">**Before bulk share script**</span><span style="color: #333333"> as follows:</span>
> 
> ```java
> var pBS = new PerspectiumBulkShare(bulkshare_gr);
> var tgr = new GlideRecord('ticket');
> tgr.addQuery('state', '1');
> tgr.query();
> while(tgr.next()){
>     pBS.addSysId(tgr.sys_id);
> }
> ```
> 
> Please note, when using the **PerspectumBulkShare.addSysId()** function and adding sys ids to the bulk share's sys id related list, only sys ids of the table specified in the bulk share should be added. The **Share only Sys IDs listed** feature only queries the table listed in the bulk share for these sys ids so if you specify sys ids of a different table they will not be found. In the above code sample, the bulk share is for the ticket table so you would only want to add sys ids of ticket records using **PerspectiumBulkShare.addSysId()**.

<u><span style="color: #000000">[↑ Go to top of page](https://docs-perspectium.atlassian.net/wiki/spaces/Lithium/pages/2326806/Optional+features+for+dynamic+shares+and+bulk+shares#Topofpage)</span></u>


---


# Create filter conditions for a dynamic share or bulk share

This feature allows you to share data only when certain conditions are met. You can also [set up filter conditions for table maps](https://docs-perspectium.atlassian.net/wiki/display/iodine/Optional+Features+of+ServiceNow+Table+Maps#OptionalFeaturesofServiceNowTableMaps-Createfilterconditionsforatablemap). <span style="color: #000000">For more information about creating filter conditions in ServiceNow, see </span>[condition builder](https://docs.servicenow.com/bundle/madrid-platform-user-interface/page/use/common-ui-elements/concept/c_ConditionBuilder.html)<span style="color: #000000">.</span>

Here's how to create filter conditions for a ServiceNow dynamic share or bulk share:

1. <span style="color: #172b4d">In</span><span style="color: #333333"> your sharing ServiceNow instance, go to </span><span style="color: #172b4d">**Perspectium**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Perspectium Core **</span><span style="color: #333333">> </span><span style="color: #172b4d">**Shares**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Dynamic Share **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**Bulk Share **</span><span style="color: #333333">> </span><span style="color: #172b4d">**View Dynamic Shares **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**View Bulk Shares**</span><span style="color: #172b4d">.</span>
2. <span style="color: #172b4d">Find and click into the dynamic share or bulk share that you want to configure.</span>
3. <span style="color: #172b4d">In the resulting dynamic share or bulk share page, click the </span><span style="color: #172b4d">**Runtime Settings **</span><span style="color: #172b4d">tab, and go to the </span><span style="color: #172b4d">**Triggers **</span><span style="color: #172b4d">section.</span>
4. <span style="color: #000000">Next to </span><span style="color: #000000">**Condition**</span><span style="color: #000000">, use the </span><span style="color: #000000">**choose field **</span><span style="color: #000000">dropdown to choose a field that you want to add filter conditions to. Then, choose an operator and value for that filter. To check which operators are available for ServiceNow field types, see </span><span style="color: #000000">[operators available for filters and queries](https://docs.servicenow.com/bundle/london-platform-user-interface/page/use/common-ui-elements/reference/r_OpAvailableFiltersQueries.html)</span><span style="color: #000000">.</span>
  1. <span style="color: #000000">To add more conditions, click </span><span style="color: #000000">**Add Filter Condition**</span><span style="color: #000000"> and repeat Step 4. To add a conditional "or" clause, click </span><span style="color: #000000">**Add "OR" Clause **</span><span style="color: #000000">instead. </span>
  2. <span style="color: #000000">(Optional!) Click </span><span style="color: #000000">**X **</span><span style="color: #000000">in line with any of the filters if you want to remove that filter.</span>
5. Click **Update**.


<u><span style="color: #000000">[↑ Go to top of page](https://docs-perspectium.atlassian.net/wiki/spaces/Lithium/pages/2326806/Optional+features+for+dynamic+shares+and+bulk+shares#Topofpage)</span></u>


---


# Encryption mode and encryption method

Perspectium supports multiple ciphers to encrypt your data when being shared out of your ServiceNow instance. The default cipher is **TripleDES**. 

You can set a different encryption cipher for your entire instance via the [Properties module](https://docs-perspectium.atlassian.net/wiki/display/iodine/DataSync+Settings) (**Perspectium **> **Control and Configuration **> **Properties** > **DataSync Settings**), OR you can set it when you create a shared/subscribed queue. You can also choose which encryption mode to use.

There available encryption modes are:

| **Mode** | **Description** |
| --- | --- |
| **encrypted** | <span style="color: #333333">Data is encrypted then base64 encoded</span> |
| **encrypted_multibyte** | Data is base64 encoded then encrypted |

:warning: If you choose **encrypted_multibyte** as your encryption method in the **DataSync Settings**, you must set your shared queue as **encrypted_multibyte **as well. 

And if you are going to change the encryption key, make sure to follow these requirements:

> ❌ <span style="color: #172b4d">With ServiceNow's planned deprecation of the </span><span style="color: #172b4d">[GlideEncrypter API](https://docs.servicenow.com/bundle/vancouver-api-reference/page/app-store/dev_portal/API_reference/GlideEncrypter/concept/GlideEncrypterAPI.html)</span><span style="color: #172b4d"> in the Zurich release</span><span style="color: #000000">, in </span><span style="color: #000000">**Krypton 8.5.0 and newer versions, **</span><span style="color: #000000">the Perspectium application </span><span style="color: #172b4d">uses JavaScript library to continue supporting the </span>Triple DES encryption method<span style="color: #172b4d">. See </span>[ServiceNow GlideEncrypter API Deprecation](https://docs-perspectium.atlassian.net/wiki/spaces/Overview/pages/1573130)<span style="color: #172b4d"> for more information.</span>

| **Encryption Method** | **Required Encryption Key length** |
| --- | --- |
| Triple DES | <span style="color: #333333">At least 24 characters</span> |
| AES-128 | At least 24 characters |
| Base64 Encode Only | At least 24 characters |
| AES-256 | <span style="color: #333333">32 characters or more</span> |


> ℹ️ **SOME NOTES:**
> ℹ️ 
> ℹ️ - When changing the encryption key, make sure to <span style="color: #333333">remove the preexisting key and add the new key. </span>
> ℹ️ - <span style="color: #333333">In certain </span><span style="color: #333333">**ServiceBond **</span><span style="color: #333333">integrations, </span><span style="color: #333333">**AES-128**</span><span style="color: #333333"> encryption may be a required cipher. Contact </span><span style="color: #333333">[Perspectium Support](mailto:mailto:support@perspectium.com)</span><span style="color: #333333"> to determine your application endpoint's specific encryption requirements.</span>
> ℹ️ - <span style="color: #333333">To ensure that foreign language strings are replicated properly between ServiceNow, instances require that </span><span style="color: #333333">**encrypted_multibyte**</span><span style="color: #333333"> encryption mode is selected on the source instance.</span>
> ℹ️ - <span style="color: #333333">To ensure that foreign language strings are replicated properly to your target database via a SQL DataSync Agent, you must configure your database connection string for UTF-8 character encoding. For example, agent.xml config is modified with </span><span style="color: #333333">*<database_parms>*</span><span style="color: #333333"> for MySQL subscriber to add the parameter </span><span style="color: #333333">*characterEncoding=UTF-8*</span><span style="color: #333333">.</span>
> ℹ️ 
> ℹ️ ```
> ℹ️ <subscribe>
> ℹ️             <task>
> ℹ️             	<task_name>multibyte_tester</task_name>
> ℹ️             	<handler>com.perspectium.replicator.sql.SQLSubscriber</handler>
> ℹ️              	<amqp_queue>psp.out.replicator.dloo_mac</amqp_queue>             
> ℹ️                 <decryption_key>The cow jumped over the moon</decryption_key>
> ℹ️                 
> ℹ️                 <database_server>127.0.0.1</database_server>
> ℹ️                 <database_user>xxx</database_user>
> ℹ️                 <database_password>xxx</database_password>
> ℹ️                 <database_port>3306</database_port>
> ℹ️                 <database_type>mysql</database_type>
> ℹ️                 <database_parms>autoReconnect=true&characterEncoding=UTF-8</database_parms>
> ℹ️                 <database>psp_repl</database>
> ℹ️             </task>
> ℹ️         </subscribe>
> ℹ️ ```

<u><span style="color: #000000">[↑ Go to top of page](https://docs-perspectium.atlassian.net/wiki/spaces/Lithium/pages/2326806/Optional+features+for+dynamic+shares+and+bulk+shares#Topofpage)</span></u>


---


# View records processed

This feature allows you to see a breakdown of the total number of records processed and shared out on a dynamic or bulk share, including the number of auxiliary records shared if options such as [Include attachments](https://docs-perspectium.atlassian.net/wiki/display/iodine/Optional+features+for+dynamic+shares+and+bulk+shares#Optionalfeaturesfordynamicsharesandbulkshares-ServiceNowattachments) are activated. 

Here's how to view the records processed:

1. <span style="color: #172b4d">In</span><span style="color: #333333"> your sharing ServiceNow instance, go to </span><span style="color: #172b4d">**Perspectium**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Perspectium Core **</span><span style="color: #333333">> </span><span style="color: #172b4d">**Shares**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Dynamic Share **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**Bulk Share **</span><span style="color: #333333">> </span><span style="color: #172b4d">**View Dynamic Shares **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**View Bulk Shares**</span><span style="color: #172b4d">.</span>
2. <span style="color: #172b4d">Find and click into the dynamic share or bulk share that you want to review.</span>
3. <span style="color: #172b4d">Scroll down to the </span><span style="color: #172b4d">**Records Processed **</span><span style="color: #172b4d">tab in the table at the bottom of the page. The tab will only appear if you have already executed the share (otherwise there will be no records sent yet).</span>

![image](media://9c59c559-44ba-432c-95c2-2a1ed623315d)



<u><span style="color: #000000">[↑ Go to top of page](https://docs-perspectium.atlassian.net/wiki/spaces/Lithium/pages/2326806/Optional+features+for+dynamic+shares+and+bulk+shares#Topofpage)</span></u>


---


# Notes

This feature allows you to include simple notes for internal communication/organizational purposes. Here's how to access:

1. <span style="color: #172b4d">In</span><span style="color: #333333"> your sharing ServiceNow instance, go to </span><span style="color: #172b4d">**Perspectium**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Perspectium Core **</span><span style="color: #333333">> </span><span style="color: #172b4d">**Shares**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Dynamic Share **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**Bulk Share **</span><span style="color: #333333">> </span><span style="color: #172b4d">**View Dynamic Shares **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**View Bulk Shares**</span><span style="color: #172b4d">.</span>
2. <span style="color: #172b4d">Find and click into the dynamic share or bulk share.</span>
3. <span style="color: #172b4d">Click the the </span><span style="color: #172b4d">**Miscellaneous **</span><span style="color: #172b4d">tab to find the </span><span style="color: #172b4d">**Notes **</span><span style="color: #172b4d">field.</span>


<u><span style="color: #000000">[↑ Go to top of page](https://docs-perspectium.atlassian.net/wiki/spaces/Lithium/pages/2326806/Optional+features+for+dynamic+shares+and+bulk+shares#Topofpage)</span></u>


---


# Switch form views

This feature allows you to switch between two "view" options when it comes to forms such as on a dynamic share or bulk share page.

The **Simple view** is designed to simplify configuration selections when creating a bulk and dynamic share. This view will contain commonly used features you can use to customize share configurations. When creating a new share configuration, you will be automatically redirected to the Simple view of that form.

The **Standard view** is a <span style="color: #172b4d">designed version that offers improved organization and a more intuitive user experience.</span> 

To check what view you're on, check the top of your dynamic share or bulk share page. If you are in the new view, it will say **Shared He20 Standard view**. Here's an example of a new view:

![image](media://d0e5f229-e81b-4fbb-9bbf-ce13a37291d0)

You may prefer one style over the other. Here's how to switch between the simple and standard view:

1. <span style="color: #172b4d">In</span><span style="color: #333333"> your sharing ServiceNow instance, go to </span><span style="color: #172b4d">**Perspectium**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Perspectium Core **</span><span style="color: #333333">> </span><span style="color: #172b4d">**Shares**</span><span style="color: #333333"> > </span><span style="color: #172b4d">**Dynamic Share **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**Bulk Share **</span><span style="color: #333333">> </span><span style="color: #172b4d">**View Dynamic Shares **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**View Bulk Shares**</span><span style="color: #172b4d">.</span>
2. <span style="color: #172b4d">Find and click into the dynamic share or bulk share that you want to update.</span>
3. <span style="color: #172b4d">Scroll down to the </span><span style="color: #172b4d">**Related Links **</span><span style="color: #172b4d">section and click either </span><span style="color: #172b4d">**Simple view **</span><span style="color: #172b4d">or </span><span style="color: #172b4d">**Standard view**</span><span style="color: #172b4d">.</span>


<u><span style="color: #000000">[↑ Go to top of page](https://docs-perspectium.atlassian.net/wiki/spaces/Lithium/pages/2326806/Optional+features+for+dynamic+shares+and+bulk+shares#Topofpage)</span></u>


---


# Add display value language

This feature allows you to change the language of [display values](https://docs.servicenow.com/bundle/madrid-platform-administration/page/administer/field-administration/concept/c_DisplayValues.html) in your sharing instance. This feature only works for language translations that have been downloaded on your instance. 

There are a couple things you need to do first in order to make use of the feature:

:check_mark: First, you need to [activate the language plugin](https://docs.servicenow.com/bundle/newyork-platform-administration/page/administer/localization/task/t_ActivateALanguage.html)<span style="color: #000000"> in your ServiceNow instance.</span>

:check_mark: Then, you need to <span style="color: #2e2e2e">[Enable DataSync to add display value fields for reference and choice fields (prefixed with 'dv_' by default)](https://docs-perspectium.atlassian.net/wiki/display/iodine/DataSync+Settings#DataSyncSettings-Sharedisplayvaluesforreferencefieldsandchoicelists)</span>

<span style="color: #2e2e2e">Finally, you're ready to set up your dynamic or bulk share to add display value languages:</span>

1. In<span style="color: #333333"> your sharing ServiceNow instance, go to </span>**Perspectium**<span style="color: #333333"> > </span>**Perspectium Core **<span style="color: #333333">> </span>**Shares**<span style="color: #333333"> > </span>**Dynamic Share **or **Bulk Share **<span style="color: #333333">> </span>**View Dynamic Shares **or **View Bulk Shares**.
2. Find and click into the dynamic share or bulk share you want to enable the feature on.
3. Click the the **Miscellaneous **tab and check the **Advanced **box. This will reveal a new **Advanced **tab (if the **Advanced **box wasn't already checked).
4. Click the **Advanced **tab and check the **Add display value language **box, then select your desired language from the **Display value language **field.
5. Click **Update**.


<u><span style="color: #000000">[↑ Go to top of page](https://docs-perspectium.atlassian.net/wiki/spaces/Lithium/pages/2326806/Optional+features+for+dynamic+shares+and+bulk+shares#Topofpage)</span></u>


---


# Data obfuscation

This feature allows your to create obfuscation rules for your dynamic/bulk shares per the <span style="color: #000000">the</span><span style="color: #172b4d"> </span>[General Data Protection Regulation (GDPR)](https://gdpr-info.eu/). This is useful for cases where you want to "mask" data contained in your share that may be classified as sensitive.

> Macro (ui-text-box)
> 
> <span style="color: #172b4d">Reference fields can not be obfuscated due to limitation of ServiceNow.</span>


Here's how to make use of data obfuscation:

1. In<span style="color: #333333"> your sharing ServiceNow instance, go to </span>**Perspectium**<span style="color: #333333"> > </span>**Perspectium Core **<span style="color: #333333">> </span>**Shares**<span style="color: #333333"> > </span>**Dynamic Share **or **Bulk Share **<span style="color: #333333">> </span>**View Dynamic Shares **or **View Bulk Shares**.
2. Find and click into the dynamic share or bulk share you want to enable the feature on.
3. Click the the **Miscellaneous **tab and check the **Advanced **box. This will reveal a new **Advanced **tab (if the **Advanced **box wasn't already checked).
4. Click the **Advanced **tab and check the **Enable data obfuscation **box.
5. Scroll down to the table at the bottom of the page and click the **PSP Data Obfuscations** tab. This will only be available if you have checked the box in Step 4.
6. <span style="color: #000000">In the </span><span style="color: #000000">**PSP Data Obfuscations **</span><span style="color: #000000">tab, click </span>**New**<span style="color: #000000">. If using Google Chrome, you may see a popup asking if you want to leave the site—click </span>**Leave**<span style="color: #000000">.</span>
7. <span style="color: #000000">Type any </span><span style="color: #000000">**Name **</span><span style="color: #000000">for your new rule and enter a number in the </span><span style="color: #000000">**Order **</span><span style="color: #000000">field to indicate when your data obfuscation rule will run compared to other data obfuscation rules in the same share (in ascending order)</span>
8. <span style="color: #000000">Finally, use the </span><span style="color: #000000">**Type **</span><span style="color: #000000">dropdown to choose a data obfuscation rule type based on the following options:</span>
  <span style="color: #000000">cation rule type from the following options:</span>
9. <span style="color: #000000">Click </span><span style="color: #000000">**Submit **</span><span style="color: #000000">to save the new rule, and then click </span><span style="color: #000000">**Update**</span><span style="color: #000000"> back in the share page.</span>

## <span style="color: #000000">Data obfuscation dashboard</span>

<span style="color: #000000">You can easily view all of your data obfuscation rules for dynamic shares or bulk shares at the Data Obfuscation Dashboard.</span>

To access, go to **Perspectium**<span style="color: #333333"> > </span>**Perspectium Core **<span style="color: #333333">> </span>**Shares**<span style="color: #333333"> > </span>**Dynamic Share **or **Bulk Share **<span style="color: #333333">> </span>**Data Obfuscation Dashboard**. You will see the same dashboard, with both dynamic and bulk shares listed, regardless of the path you get there.

<span style="color: #000000">The Data Obfuscation Dashboard is essentially just a breakdown of all existing rules. The first column in the tables show the name of each share which will take users to the respective share when clicked on. The table specifies which table each share is targeting. The last three columns show each type of data obfuscation (Field, Pattern, or Replacement). A green checkmark indicates at least one data obfuscation rule of that type is active for that share, whereas a red X indicates no data obfuscation rule of that type is active. The dashboard also shows the total number of records obfuscated from each table as well as the total number of obfuscation rules on each table.</span>


<u><span style="color: #000000">[↑ Go to top of page](https://docs-perspectium.atlassian.net/wiki/spaces/Lithium/pages/2326806/Optional+features+for+dynamic+shares+and+bulk+shares#Topofpage)</span></u>

---

# Truncate Fields

> ℹ️ Available in **Lithium 9.7.0 and newer**

Because ServiceNow allows you to enter more text than you define as the field’s max length, this feature allows you to truncate the text to the max length of the field.

This is one way to avoid performance issues when the Perspectium application is trying to query for a record and it takes a long time to query and create the outbound message for sharing due to the abnormally large size of one field in the record.

To avoid having to truncate every single field of a record (which would take a long time to process), you specify the max length value you want to truncate in [DataSync Settings](https://docs-perspectium.atlassian.net/wiki/spaces/Lithium/pages/2327410). Any field that has a max length equal to or greater than this value will be truncated to the field’s maximum length with a Before Share Script. 

For example, if your table has two fields (description with a max length of 4000 and notes with a max length of 8000), and you specify the max length to truncate as 4000 in DataSync Settings, when you select the **Truncate Fields** option on your share, this will create a **Before Share Script** on the share with:

```
// START TRUNCATE FIELDS SCRIPT
if (String(current.notes).length > 8000) {
	current.notes = String(current.notes).substring(0, 8000);
}

if (String(current.description).length > 8000) {
	current.description = String(current.description).substring(0, 8000);
}
// END TRUNCATE FIELDS SCRIPT
```

![truncate_fields_before_share_script_example.png](media://d7b5c9b1-e2aa-4d0d-9f20-5a3e51dfc438)

Here’s how to enable this feature.  

1. Create a [bulk share](https://docs-perspectium.atlassian.net/wiki/spaces/Lithium/pages/2326799) or [dynamic share](https://docs-perspectium.atlassian.net/wiki/spaces/Lithium/pages/2326993).
2. Select the **Standard view **Related Links UI action at the bottom.
3. Go to the **Advanced** tab.
4. Go to the **Runtime Settings** section and select the **Truncate fields** option.
5. Save your share.

If you go back into your share now and go to the **Scripting** tab, you will see the added script to truncate fields that have a max length greater than or equal to the value specified in DataSync Settings. To distinguish the truncate fields script from any other script you have in the Before Share Script, the truncate fields script will be surrounded by the **// START TRUNCATE FIELDS SCRIPT** and **// END TRUNCATE FIELDS SCRIPT **comments.

> ℹ️ Notes:
> ℹ️ 
> ℹ️ - For bulk shares, like other bulk share configurations, you can only enable/disable the Truncate Fields option before it has executed.
> ℹ️ - \n, \t (for newlines and tabs) and other similar formatting characters are counted as characters when truncating since these characters are actually in the content. So you may not see exactly the same number of characters on screen as the max length truncated i.e. you may not see exactly 4000 on screen characters and instead may see slightly less to account for formatting characters. This is what the system retruns to us as 4000 characters when we request for a truncated version.
> ℹ️ - To prevent duplicate truncate field scripts and also account for changes in the sharing table’s fields and their definitions (such as a new field being added with a max length greater than the current setting), when you update a share with this option enabled, it will delete anything between the **// START TRUNCATE FIELDS SCRIPT** and **// END TRUNCATE FIELDS SCRIPT **comments to rebuild the truncate fields script. So any content you type in manually between these comments will also be deleted. Any scripts that is outside of these comments will be maintained in the Before Share Script.
> ℹ️ - When you toggle off the Truncate Fields option, it will delete the truncate field script currently in the Before Share Script, deleting any content between the **// START TRUNCATE FIELDS SCRIPT** and **// END TRUNCATE FIELDS SCRIPT **comments.


<u>[↑ Go to top of page](https://docs-perspectium.atlassian.net/wiki/spaces/Lithium/pages/2326806/Optional+features+for+dynamic+shares+and+bulk+shares#Topofpage)</u>