How to access the Product Inventory sys_id in a scripted context variable during asset-based
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
14 hours ago
Description:
I'm using ServiceNow SOM-TMT with Logik.io CPQ (asset-based ordering). When a user clicks "Customize" on a Product Inventory record to create a Change Order, I need to pass the root PI sys_id into Logik as a context variable so I can use it in enrichment scripts.
The problem:
In the scripted context variable, current is the Order header and attributeContext is empty
The OLI table hasn't been synced yet at configuration time, so I can't query sn_ind_tmt_orm_order_line_item
The entityDetails.inventoryId field in the front-end payload contains exactly what I need, but it's not accessible from server-side context variable scripts
What I've confirmed:
The front-end payload has entityDetails.inventoryId with the correct PI sys_id
The sourceInstance.lineItems[0].attributes.source_sold_product.value also contains the PI sys_id
The context variable script only has access to current (the order GlideRecord) and attributeContext (empty object)
What I've tried:
Field Mapping in Logik blueprint with BOM Item Unique Identifier and various mapping paths (lineItems.source_sold_product, item.source_sold_product, source_sold_product) — none populated the target field
My question:
What is the correct Mapping Path syntax for the Context Line Variable field mapping to read source_sold_product from the PI-based payload?
Is there another way to make entityDetails.inventoryId available to a server-side context variable or Logik enrichment script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
14 hours ago
Adding print screen of Logik where I tried to configure the field mapping for the line item, to retrieve the Product Inventory from Logik session