How to Create a Variable for each selected column within For Each Row activity

I am doing an RPA bot challenge. I have to scrape data from a website that has fake credit card dump details from a fake dark web website where people would be able to buy these cards. From that website, I extracted all the necessary fields into a data table. From that data table I need to compare the information with a fake company’s customer details and credit card details to see if any other of their customers’ credit cards appeared in this dark web credit card dump. I am now at the point where I need to use a For Each Row activity to run through each row in the credit card dump and extract certain columns that I need to compare them to the bank’s customer database. How do I do this successfully?

I have tried entering in specific details in my ‘Run Query’ and it successfully returns the necessary data. For example:

“SELECT customer_id,first_name,last_name,card_number,cvv,brand
FROM customer_details,card_details
WHERE customer_details.customer_id = card_details.id AND expiration = ‘2/27’ AND zip = ‘12345’;”

But now, I am having a problem when I need to make the values for each (expiration and zip) dynamic because they will change with each row that is looked at. I tried to create a variable for each of these two but it’s not working:

“SELECT customer_id,first_name,last_name,card_number,cvv,brand
FROM customer_details,card_details
WHERE customer_details.customer_id = card_details.id AND expiration = ‘Expiration’ AND zip = ‘Zip’;”

where Expiration and Zip are variables.

I suspect the issue is that I have not entered the assign details correctly when I want to assign the data in column 1 (Expiration) and column 7 (Zip) to a variable.

I hope this makes sense.

@Sinenhlanhla_Shelembe

Assign is correct issue is with query, try the below one

"SELECT customer_id,first_name,last_name,card_number,cvv,brand
FROM customer_details,card_details
WHERE customer_details.customer_id = card_details.id AND expiration = '"+Expiration +"' AND zip = '" + Zip + "';"

cheers

It’s a waste of time to assign the values to variables. Just use CurrentRow(“columname”).ToString wherever you need the value.

2 Likes

This way seemed to work? How do I get the process to log every match because at the moment it only logs one match every time I run the file. But there is more than one match. I put the process into a do while loop with a maximum number of 500 iterations. So, the logic is, find a match and then write range to an excel file and then repeat the process.

The response above seems to be working so far. If it ultimately doesn’t work, I will try yours.

I appreciate your help.

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