Level 1 Foundation Training - Lesson 3 Data Manipulation

Greetings!

(Thanks for the help on my previous question! Great help!)

I’m trying to go through the Data manipulation lesson and I get an error. In it, I’m supposed to read from an csv file, then use a For Each to get the first and last name. The read and assign work, including filtering to members only.

However, the foreach does not work. Specifically, the row(“First”).ToString call gives me an error of Method Name expected. I’m following the example as written but it’s not working there.

What am I doing wrong?

Thanks!

Hi! Not sure what are you doing but Maybe you need to use for each row activity…

image

Thanks! I will try that and see what happens!

1 Like

HI @jgoranso

Just like @carmen mentioned, you need to use the for each row activity when you are looping through data tables… For Each is used for a different purpose…

1 Like

Greetings!

Thanks for the replies. I figured out my issues. It was a strange syntax error.

I could use the standard For Each. Further, I used the For Each with a dataTable object and that worked fine. I’m curious about the For Each Row and how it differs.

The problem was syntax. I had row(“First”).ToString. I had to change that to row[“First”]. That wasn’t enough as it didn’t like it and row[“First”].ToString also gave me a problem. So, the final thing that worked for me was (string)row[“First”].

Thanks for the ideas! Got me there!

Just use for each row activity. And confirm if it solves your problem.