So question, you are trying to remove the index [7] which you say is an /r , now is the file holding a /r or is it just that you know they are there?
Also when I try to put your code into a (not clearner but a format to make clear what goes with what hierarchy wise.
if(
equals(
// ok so take the index of 7 and replace /r with '' (empty string but NOT null)
replace(split(item(),',')?[7],decodeUriComponent('%0D'),'')
'',null,split(item(),',')?[7])
)
Ok lets start our break down
if(equals(replace(split(item(),',')?[7],decodeUriComponent('%0D'),''),'',null,split(item(),',')?[7]))
Ok remember Ifs do the following
If( something, is true, do x, if not true do y)
But you didn't write yours that way. look closely
if(
// so we need JUST the expression to evaluate between the equals() // but you have a lot more
equals(replace(split(item(),',')?[7],decodeUriComponent('%0D'),'')
Problem
#1 is I need to close the Equals.. but i cannot. The above code closes the REPLACE statement only, so you should have another ) right after close the replace, but you do not, you have an , and then bla bla.. so its like you were trying to do the if(true/false, true, false) but wrote the stuff in the equals section so, I am going to add the ) in my third writeup below
,'',null,split(item(),',')?[7])
)
// fixing #3
if(
// so we need JUST the expression to evaluate between the equals() // but you have a lot more
equals(replace(split(item(),',')?[7],decodeUriComponent('%0D'),'')) <== I added this to close the equals
NOW, i can use your next comma,,which belongs to the IF not the equals
,
// Next Problem. You should have an expression to return or do something, you dno't you have the below stuff left, none of this stuff will work.
As you see I moved part of it down to represent the False part of the If, the issue is you still have that ", null
which doesn't make sense. you probably JUST want the
null
//'',null and get rid of this
,
// I used the comma right after null, to be the FALSE section of your if
split(item(),',')?[7])
)
Clean Copy
if(
equals(replace(split(item(),',')?[7],decodeUriComponent('%0D'),''))
,
null
,
split(item(),',')?[7])
)
And thats where I believe your issue is
If this helps please mark as the answer.