Open kirannarala opened 4 years ago
I just made some changes.
[
{
"operation": "remove",
"spec": {
"reco": {
"*": {
"yami_flg": "",
"no_image_flg": "",
"rms_shop_id": "",
"review_score_average": "",
"review_count": "",
"stock_status": "",
"adult_flg": "",
"rms_item_id": "",
"score": "",
"id": "",
"genre_id": ""
}
}
}
},
{
"operation": "modify-overwrite-beta",
"spec": {
"reco": {
"*": {
"link": {
"webUrl": "=concat('https://books.rakuten.co.jp/rb/',@(2,rms_item_no),'&rtg=',@(4,tracking_tag))",
"appLinkAndroid": null,
"appLinkIos": null
}
}
}
}
},
{
"operation": "shift",
"spec": {
"reco":{
"*":{
"title":"items.[&1].title",
"note":"items.[&1].subtitle",
"img":"items.[&1].imageUrl",
"link":"items.[&1].link"
}
}
}
},
{
"operation": "default",
"spec": {
"title": "テストサンプルテキスト",
"serviceName": "テストサンプルテキスト",
"serviceIcon": "Some Service Icon",
"serviceHistoryImage": "Some Image",
"serviceLink": {
"webUrl": "https://google.com/",
"appLinkAndroid": "",
"appLinkIos": ""
}
}
}
]
Hi @kirannarala . The error was judged at the position of 'tracking_tag', it is not at the same level as "rms_item_no", you can refer to my example above. Actually, I want to say that you are doing well.
Hi @zeshuai007
Thank you for the quick response.
when i have some Japanese text for example "title": "テストサンプルテキスト"
in the above sample when i transform the JSON i am getting some thing like this "title" : "?????????? "
. Am i missing something to achieve that.
Secondly what is the prominence of the below notations
@(4,tracking_tag),
items.[&1]
And can you help me with the documentation of above please
Many "???" are just encoding problems, because I use UTF-8, you can delete or overwrite it with your local Japanese text. I ’m using the ‘modify-overwrite-beta’ operation. It only handles URL splicing. @ (4, tracking_tag) is just to resolve your URL-level errors. And
"title": "= concat (@ (1, title), '')",
"subtitle": "= concat (@ (1, note))",
"imageUrl": "= concat (@ (1, img))",
these changes to the Json structure are placed in the 'shift' operation.
I Have some input JSON from upstream as below
And i want the transformation of JSON to below output JSON
and below is the Spec which i wrote by understanding the Jolt documentation
and can you provide some more documentation for how to traverse back to tree and set the values to items current node. For example in the above given input sample i have Tracking_tag which i need to add at the end of the Url as query parameter And what is the role of &1 and @1. Thanks In Advance, Kiran Kumar