You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have a requirement where I want to convert string values to Boolean, Integer or Decimal based on a property called 'field_data_type'. When value against field_data_type is boolean I want to convert the 'value' field to boolean and similarly for Integer conversion.
Is there a way I can achieve this using Jolt spec. Here is my sample input.
The text was updated successfully, but these errors were encountered:
abhinaypandey
changed the title
using Conditions inside modify-overwrite-beta transformation specs
using Conditions inside modify-overwrite-beta transformation specs for type conversion
Sep 19, 2023
Hi,
I have a requirement where I want to convert string values to Boolean, Integer or Decimal based on a property called 'field_data_type'. When value against field_data_type is boolean I want to convert the 'value' field to boolean and similarly for Integer conversion.
Is there a way I can achieve this using Jolt spec. Here is my sample input.
{ "name": "Consumer", "email": "", "form_id": "G0FZJeRPTsep6kjqBuxvKg", "tags": [], "field_list": [ { "name": "Hungry", "value": "true", "required": false, "source": "External", "id": "8fz9bob1Rt-JF3DJT2XeLg", "ui_property": "single-select", "field_data_type": "boolean", "is_editable": false, "visible": false, "related_to": "Ticket", "target_property": "conversation::hungryBool", "is_agent_only": false, "is_custom_field": true, "is_auto_generated": false, "is_prefill_variable": false, "prefill_value": "", "is_visible_to_customer": true, "is_active": true }, , { "name": "Lot Number", "value": "1", "required": false, "source": "External", "id": "TzMfuHwXSUioVxulzSwxeA", "ui_property": "text", "field_data_type": "number", "is_editable": false, "visible": false, "related_to": "Ticket", "target_property": "customer::lotNumberTxt", "is_agent_only": false, "is_custom_field": true, "is_auto_generated": false, "is_prefill_variable": false, "prefill_value": "", "is_visible_to_customer": true, "is_active": true } ]
[ { "operation": "modify-overwrite-beta", "spec": { "field_list": { "*": { "target_property_split": "=split('::', @(1,target_property))", "kustomer_attribute_type": "@(1,target_property_split[0])", "attribute_target_property": "@(1,target_property_split[1])" } } } }, { "operation": "shift", "spec": { "requester": { "type": { "Customer": { "@(2,id)": "customer" } } }, "field_list": { "*": { "kustomer_attribute_type": { "conversation": { "@(2,is_custom_field)": { "true": { "@(4,value)": "custom.@(5,attribute_target_property)" }, "*": { "@(4,value)": "@(5,attribute_target_property)" } } } } } } } } ]
The text was updated successfully, but these errors were encountered: