How to map the virtual inbound field at consumer side - service bridge

JohnDoe2
Tera Contributor

Hi Folks, 

I have couple of custom fields on the incident table on the consumer side which do not exist on the provider side. 
I have created a virtual outbound transform on the provider side and sending the values . 


output.value = {"custom_field1:value1","custom_field2:value2"}; 

output.label = "Custom Fields" ; 


On consumer side I have created the virtual inbound transform and getting those values.

My question is , how can I map these values now to the fields on the consumer side . I am getting some weird behaviour if I do  a gliderecord and update the record with these values in the inbound transform on the consumer side. 

 

Any inputs would be helpful thanks, 

3 REPLIES 3

Vinay49
Tera Expert

Hi John,

 

Did you get any solution for this?

BobbyNow
ServiceNow Employee
ServiceNow Employee
  • The cleanest method for custom fields that closely match fields in the PRO instance is example 1.
  • When the fields are unique to the consumer, and no single field to pull the values from exists in the provider, virtual fields are recommended. You should create one virtual mapping per custom field so that no tricks are needed on the consumer. Please take a look at example 2 for this.


Example 1: There is a state field on Provider and a custom field called u_state on the consumer
1. Since there is a "close match" source and target, the easiest method is to map state > state when creating the definition on the provider. Next, when the consumer receives the definition, they can change the target to u_state before activating the definition.

 

Example 2: The consumer has a unique field we will call widget that is required but no match for the provider.

2. In this case, the provider can create a virtual outbound mapping called widget that requires no source and set the sync when to never, so it requires no target. Next, the provider makes a virtual outbound transform for widget and uses a script to set the output label and value. Finally the consumer adjusts the mapping to sync on insert or insert/update and then sets the target field to widget before activating the definition.

The consumer can also use a virtual inbound transform if further data manipulation is needed.

In your example2, is it possible if it's the opposite? Provider has a custom field that does not exist on the consumer side.