I'm attempting to parse email body to excel file. After some manipulations, my current output is an array, where each line is data related to a product.
[
"Periods: 01.01.2023 - 01.02.2023 | Code: 111 | Code2: 1111 | product-name",
"Periods: 01.01.2023 - 01.02.2023 | Code: 222 | Code2: 2222 | product-name2"
]
I need to replace the 3rd occurrence of " | "
with " | Product: "
, so i can get field Product before the product name.
I've tried to use Apply to each -> current item -> various ways to find 3rd occurrence and replace it, but can't succeed. Any suggestion?
You should be able to loop through each item and perform a simple replace expression like thus ...
replace(item(), split(item(), ' | ')[3], concat('Product: ', split(item(), ' | ')[3]))
That should get you across the line. Of course, I'm basing my answer off the limited information you provided.