Using dt.select() with data tables

Hello - I am having trouble with the attached workflow where I am trying to use dt.select() functions to add a value from one dt to another dt. I am getting the error Assign: Index was outside the bounds of the array. Can anyone help as to what I am doing wrong?

I have attached the workflow to this question. Thanks in advance. TestProcessDTSelect.zip (28.2 KB)

@Cormac It is not working because in the assign select condition you are passing wrong arguments.
You should use the expression below and see if thatā€™s your expected output.
ReportDT.Select(ā€œConvert([Model],ā€˜System.Stringā€™)='ā€+row.Item(ā€œMaterialCodeā€).ToString+ā€œ'ā€)(0)((ā€œVendor Numberā€).ToString)

image

1 Like

Hi @Pravin_Patil1 - I tested your solution but it seems it is looking for a column which doesnā€™t exist.

ReportDT.Select(ā€œConvert([Model],ā€˜System.Stringā€™)=ā€™ā€+row.Item(ā€œMaterialCodeā€).ToString+ā€œā€™ā€)(0)((ā€œVendor Numberā€).ToString)

Paste this as it is in assignā€¦I think you did some changeā€¦The column name I can see in exception I didnā€™t provide in assign

It is working fine for me. Below output Iā€™m getting

1 Like

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