"Column does not belong to table" but index shows it does

I have had this error earlier this week, see: Column does not belong to table - but writing the table shows it does? The problem in my previous post was mysteriously resolved by re-writing the data table name (perhaps it was written in wrong in the first place).

This is the same project, but a different part of my workflows. I am getting an error that the column name does not belong to the table. I am bringing in the Data Table and the index column as arguments. (in_firstDataTable, and in_firstDTIndexColumn, respectively.) I am trying to show in these log messages that if i get the column name by index, it matches the argument that i am asking it to retrieve from the table.

Here are screenshots of my code:
image
The specified index column is the 3rd column in the table (2nd index). As you can see in the first log message box. Then I am writing the argument value in the second message. Then the third message results in this:

Copied lines of results (to show there are no extra spaces).
Line 1: Emp No
Line 2: Emp No
Line 3: Exception Occured during Process Column ‘Emp No’ does not belong to table . Source Invoke addDataForUpdatedReport workflow: Log message

2 Likes

To add to the confusion: i’ve now used the index of the data table to set the value of the in_firstDTIndexColumn argument - and then tried to retrieve it from the table again and it says it doesn’t exist.

image
image

Check add headers in Read Range Activity.

dt.rows(0)(2).tostring should not return columnName. It means that, Column name is not considered as headers.

3 Likes

Hi @kappk

The screenshot of the last log message doesn’t show the entire expression, but I think what you’re trying to do is you’re trying to use the “Emp No” as the column name (stored in the argument “in_firstDTIndexColumn”). But note that “Emp No” is NOT the column name. It’s the data value at Row index 0 column index 2, and you’re trying to use THAT as your column name.

Let me know if you’re still not able to understand this.

2 Likes

@Vivek_Arunagiri and @siddharth you guys are so smart. Thank you for your help :smiley: I knew it was probably something simple…

I didn’t realize you had responded and just finally came to this conclusion on my own.

1 Like

@kappk we try to do the little that we can, but thanks for the compliment. You’re too kind.

Anyway, I’m glad you found the solution on your own. Have a great day!

1 Like

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