To remove characters from the start and end of a string you’ll need to use the replace() string function to clean up the JSON first.
Then you can use the Parse JSON module inside of the JSON app to covert the JSON object into an output bundle that you can process with subsequent modules.
Here’s a functional example can try as the input to the Parse JSON module:
{{replace("|{""tags"":[""travel tips"",""travel destinations"",""backpacking tips""]}|"; "|"; emptystring)}}
To install the scenario blueprint (JSON) I made for you follow these steps:
- Expand the “Scenario Blueprint” by clicking on the arrow
- Copy the blueprint text into your clipboard using the copy button in the top-right of the code block (you can also select the text manually)
- Paste the text into a new scenario.
Your new scenario will now have all the modules I used to simulate an attempt at a solution to your question. You may need to confirm the configuration or reselect connections of each imported module in the scenario.
Scenario Blueprint
{
"subflows": [
{
"flow": [
{
"id": 1,
"module": "json:ParseJSON",
"version": 1,
"parameters": {
"type": ""
},
"mapper": {
"json": "{{replace(\"|{\"\"tags\"\":[\"\"travel tips\"\",\"\"travel destinations\"\",\"\"backpacking tips\"\"]}|\"; \"|\"; emptystring)}}"
},
"metadata": {
"designer": {
"x": 0,
"y": 0,
"messages": [
{
"category": "last",
"severity": "warning",
"message": "A transformer should not be the last module in the route."
}
]
},
"restore": {
"parameters": {
"type": {
"label": "Choose a data structure"
}
}
},
"parameters": [
{
"name": "type",
"type": "udt",
"label": "Data structure"
}
],
"expect": [
{
"name": "json",
"type": "text",
"label": "JSON string",
"required": true
}
]
}
}
]
}
],
"metadata": {
"version": 1
}
}
–
Alex Sirota
Check out Make for Make Newbies Video Series
My Solutions on Make Community