Item information from excel

Hi, I am trying to add queue item information using add queue item. Item information. Its supposed to read from an excel. But one row is reading fine the other is not coming as null. I have a for each . I tried doing an assign. “From row in dttable. Asenumerable()select convert.tostring(row( “names”))). To list . Please help the assign is inside the for the each and the add queue item

@Sira

If you are looping on the row I am not sure why you areusing linq again…

Do you want multiple items to be added at once ? If so then use add bulk queue items directly by sending datatable with data you need

Cheers

I have for each loop to stop duplicating so in that for each i have add queue item. Is there any way I can get this done with add queue item (item information)

@Sira

you can

also if you want to remove duplicates…then you can use linq and get only those rows which are not usign single assign and linq query

requireddt = dt.AsEnumerable.GroupBy(function(x) x("ColName").ToString).Select(function(x) x.First).CopyToDatatable

Now new table has only non duplicate rows based on a single column colname…

even in for loop you can do with out the above as well using if

  1. for each row
  2. If condition to check the duplicates
  3. not duplicate add item to queue and store unique key for reference
  4. else donot add and do ot store as it is duplicate

cheers


This is the error im getting when i use for item information in add queue item. I just want it to read data from a column in the excel sheet.
I have an assign inside the for each with this

@Sira

you dont need assign

first use for each row in datatable

inside that in item collection…click on 3 dots and add new item and give currentRow("Item_Status").ToString…this should add respective column to the queue item

cheers

1 Like



This is inside the for each loop im still getting an error.

@Sira

in item information is where you would give that I see you added already two items

cheers

1 Like


When i use that current row it still giving me an error. Am i doing something wrong

@Sira

does your for loop show currentRow only?

also did add .ToString?

cheers



Yes i did add to string

@Sira

First of all…the for loop should be on datatable…basically use for each row in datatable and give the datatable as input in the for loop

And then inside you can use this

You are looping some document list…not sure what it is…if want this loop only then directly use sandi in the item collection

Cheers

1 Like

Thank you for the help

1 Like


All the information is coming in from that row together any way I can split like each row with each information?

@Sira

In stead of joining with comma join with environment.Newline

Cheers

1 Like

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