Compare rows from two separate data tables

Hello,

I am trying to compare string values from Orchestrator to a row from a data table in Studio. I cannot get the condition to match if they are equal. The “Locals” panel when debugging shows me they are exactly the same values. Not sure what I am doing wrong. Here are some sample screenshots with edits to hide the addresses.

This is what the row looks like when I grab from a “for each row in data table”. This comes from a data table I got when extracting data from a web page.

image

This screenshot below is one I made using values I got from Orchestrator. I added Environment.NewLine to allow the rows to separate.

image

I cannot figure out why the condition wouldn’t be true here? They match.

If anyone could help, that would be awesome. Thanks.

EDIT: Let’s assume the “street line” in the pictures are the same. I edited those manually before taking the screenshot.

Something else I did notice: The values in the “Locals” panel in debugger do look different, even though the values are the same, which is odd. The preview for the value stops after the first street line until I click on the pencil. The preview for the other row I’m trying to compare shows the whole address in the same line until you click the pencil.

@Josh_James

The new line characters might be different in both…

Try removing from both and check …you can use replace function

System.Text.RegularExpressions.Regex.Replace(str,"\s","")

This will replace any space or neeline characters from string

Cheers

1 Like

Hello Anil and thanks for the reply,

I inserted my string variable where you have “str”, but I’m getting an error:

Did I do this wrong?

Oh sorry, I noticed an “a” was missing. I’ve added that and will try again.

That worked perfectly, thank you so much!!!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.