09-20-2021 05:42 AM
Hi Everybody,
Kindly help.
Am trying to insert a dynamic value under the **value** array using extend function but unable to do so.
[
{
"entity":
{
"attributes":
{
"type":"CustomField","url":"A"
}
"Metadata":
{
"valueSet":
{
"value":
[
{
"color":null,"default":false,"description":null,"isActive":null,"label":"None","urls":null,"valueName":"None"
},
{
"color":null,"default":false,"description":null,"isActive":null,"label":"Country","urls":null,"valueName":"Country"
},
{
"color":null,"default":false,"description":null,"isActive":null,"label":"Employee","urls":null,"valueName":"Employee"
},
{
"color":null,"default":false,"description":null,"isActive":null,"label":"Both","urls":null,"valueName":"Both"
}
]
},
},
},
},
{
"src_code":"Active","tgt_code":null
}
]
Output:
[
{
"entity":
{
"attributes":
{
"type":"CustomField","url":"A"
}
"Metadata":
{
"valueSet":
{
"value":
[
{
"color":null,"default":false,"description":null,"isActive":null,"label":"None","urls":null,"valueName":"None"
},
{
"color":null,"default":false,"description":null,"isActive":null,"label":"Country","urls":null,"valueName":"Country"
},
{
"color":null,"default":false,"description":null,"isActive":null,"label":"Employee","urls":null,"valueName":"Employee"
},
{
"color":null,"default":false,"description":null,"isActive":null,"label":"Both","urls":null,"valueName":"Both"
},
{
"color":null,"default":false,"description":null,"isActive":null,"label":"Active","urls":null,"valueName":"Active"
}
]
},
},
},
}
]Preformatted text
09-21-2021 02:51 AM
the expected Output is as follows:
[
{
"entity":
{
"attributes":
{
"type":"CustomField","url":"A"
}
"Metadata":
{
"valueSet":
{
"value":
[
{
"color":null,"default":false,"description":null,"isActive":null,"label":"None","urls":null,"valueName":"None"
},
{
"color":null,"default":false,"description":null,"isActive":null,"label":"Country","urls":null,"valueName":"Country"
},
{
"color":null,"default":false,"description":null,"isActive":null,"label":"Employee","urls":null,"valueName":"Employee"
},
{
"color":null,"default":false,"description":null,"isActive":null,"label":"Both","urls":null,"valueName":"Both"
},
{
"color":null,"default":false,"description":null,"isActive":null,"label":"Active","urls":null,"valueName":"Active"
}
]
},
},
},
}
]
09-21-2021 02:55 AM
As I said in my previous reply, enable Pass through in the Mapper. You’ll get the following result:
{
"entity": {
"attributes": {
"type": "CustomField",
"url": "A"
},
"Metadata": {
"valueSet": {
"value": [
{
"color": null,
"default": false,
"description": null,
"isActive": null,
"label": "None",
"urls": null,
"valueName": "None"
},
{
"color": null,
"default": false,
"description": null,
"isActive": null,
"label": "Country",
"urls": null,
"valueName": "Country"
},
{
"color": null,
"default": false,
"description": null,
"isActive": null,
"label": "Employee",
"urls": null,
"valueName": "Employee"
},
{
"color": null,
"default": false,
"description": null,
"isActive": null,
"label": "Both",
"urls": null,
"valueName": "Both"
},
{
"color": null,
"default": false,
"description": null,
"isActive": null,
"label": "Active",
"urls": null,
"valueName": "Active"
}
]
}
}
}
}
]
09-21-2021 03:04 AM
Thanks Boston , its working Now.
09-20-2021 10:56 AM
@KTsnap When including JSON or code in a post to this forum, please use the “Preformatted text” feature of this editor. It’s the 6th icon from the left, and looks like this: </>
This greatly enhances readability, and also allows the content to be copy/pasted in a usable way. If you don’t use the feature on JSON, the editor will modify the double quote characters so that the resulting data isn’t usable if it’s copy/pasted. It also loses all the indentation, which makes it very hard to read.
Thanks.
09-20-2021 07:25 PM
Hey thanks Taylor. i done the modification and indeed it helps in readability.