My read range and assign are pulling from the wrong data table

Hello,

I’m reading an Excel spreadsheet using Excel Application Scope with a Read Range and I’ve assigned the data table name as “workinprogress”. I’m also using an assign as follows:
ReqType = row(3).ToString
to pull that cell data. The issue I’m having is that instead of pulling the data from the Excel file I’ve specified, its pulling different data from the same row(3) in a different spreadsheet. I am using that spreadsheet much further up in the workflow. How do I correct this error?

Could you please share your code here?
You also can check if there’re 2 variables with same name but difference scope or not.

@Doanh - Thank you,I’ve attached the main. Please disregard the blue validation warnings in the first activity. I had to remove some things.

The issue I’m having is found in the second activity For each loop and then it is at the very bottom of the activity in the Validate status of transaction activity and then it is in the Action if active activity. I’ve checked and I’m not seeing any double usage of the variable ReqType

Thank you for your help

Main.xaml (128.6 KB)

@gameplayer13905
I’m not sure about your code logic, but i found some problem:

  1. You delcared same variable with difference scope
  • 2 dtDSLOA variables: one with “For each loop” scope, and one with “Main” scope
  • 2 ExtractDataTable variables: one with “Data Scrapping” scope, and one with other “Data Scrapping” scope
    → it’s high risk
  1. About reqType, Are you thinking where is it get data from? dtDSLOA datatable’s row, or WorkInProgressTransactionTable datatable’s row?
    In your code, reqType is assigned value after ReadRanger of WorkInProgressTransactionTable , so maybe you want to get data from WorkInProgressTransactionTable ?
    But you’re using row(3).ToString to assign to reqType, this row variable belongs to dtDSLOA
    To get data from WorkInProgressTransactionTable, you need one more for each here, or using WorkInProgressTransactionTable.Rows(xx)(yy).ToString - base on your requirement

@Doanh

Thank you.
Your Part One - I will work on it
Your Part Two - Yes I want the assign activity to pull from WorkInProgressTransactionTable row 3. Does this actually work?
Assign: ReqType = WorkInProgressTransactionTable.Row(3).ToString

I am marking this as solved because I added a For Each Row activity and that resolved the issue

@gameplayer13905
Nice to hear it.
But you should select my comment as solution, not your comment

To get data from WorkInProgressTransactionTable, you need one more for each here, or using WorkInProgressTransactionTable.Rows(xx)(yy).ToString - base on your requirement

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