Remove quotation marks from split function:

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:
image

Result input after split function:
image

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.

Screenshot_2024-01-30_000114

You can map the variable “array” in a later module, and you can name it something else, like ids.

2 Likes

Hi @samliew

Sorry never worked with this JSON Parse module, i receive the below data error?

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

@samliew

Please find attached document, hopefully this will explain my automation challenge.

Make data modules and explanation.pdf (274.8 KB)

2 Likes

Thanks for putting together a document explaining everything again.

But have you tried my suggestion yet?

Screenshot_2024-01-30_080150

Regex test: https://regex101.com/r/9HAUoE

3 Likes