TT92
January 29, 2024, 2:31pm
1
Hi community,
Hopefully somebody can help me out with a simple solution.
I need to split an array of value’s, only my input value adds quotationmarks (" ") and unfortunately i get a bad request 400 as the dataset need to be a number:
Result input after split function:
What my values needs to be:
Hopefully somebody can get me to the right combination of functions, i tried already to combine a replace function, but without success unfortunately…
Thank you very much in advance!
Best Regards,
The easiest way I could think of is to use the Parse JSON module
{ "array": [ {{42.array[1].value}} ] }
It’s hacky, but it only takes a single operation.
You can map the variable “array” in a later module, and you can name it something else, like ids
.
2 Likes
TT92
January 29, 2024, 7:26pm
3
Hi @samliew
Sorry never worked with this JSON Parse module, i receive the below data error?
samliew
January 29, 2024, 10:38pm
4
Looks like you have too many excessive commas, plus you can’t end with a comma. Next time please include your variable values in your question.
So you’ll need to clean your CSV input using the built in replace function.
{{ replace(array; "/((?<=,),|^,+|,+$)/g"; emptystring) }}
/((?<=,),|^,+|,+$)/g
2 Likes
TT92
January 30, 2024, 12:09am
5
@samliew
Please find attached document, hopefully this will explain my automation challenge.
Make data modules and explanation.pdf (274.8 KB)
2 Likes
samliew
January 30, 2024, 12:48am
6
Thanks for putting together a document explaining everything again.
But have you tried my suggestion yet?
Regex test: https://regex101.com/r/9HAUoE
3 Likes