Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add URLs to nested objects in record - Data Output Agent #3330

Open
ryphez opened this issue Oct 22, 2023 · 1 comment
Open

Add URLs to nested objects in record - Data Output Agent #3330

ryphez opened this issue Oct 22, 2023 · 1 comment

Comments

@ryphez
Copy link

ryphez commented Oct 22, 2023

Hey all, trying to figure out how to use a Data Output agent to modify urls nested in an array. The items I want to modify are the sub-item "image" with a pre and post fix url. Such as taking "tif/zz/23/07/13/00/1122071196B7_OM_F" and making it "http://site.com/tif/zz/23/07/13/00/1122071196B7_OM_F.jpg" by adding "http://stie.com/" to the front and ".jpg" to the end. The records don't always have 3 items in the image array which is what's making this more challening

Sample record

{
"color": "Grey",
"image": [
{
"type": "onFront",
"image": "tif/zz/23/07/13/00/1122071196B7_OM_F",
"modelID": "11429647"
},
{
"type": "onBack",
"image": "tif/zz/23/07/13/00/1122071196B7_OM_B",
"modelID": "11429647"
},
{
"type": "offFront",
"image": "tif/zz/23/07/13/00/1122071196B7_OF_F"
}
]
}

@irfancharania
Copy link
Contributor

You should be able to use liquid templating to append and prepend text:
https://shopify.github.io/liquid/filters/append/
https://shopify.github.io/liquid/filters/prepend/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants