Select few fields in QueueItems and convert to Datatable

Hi All

I have below QueueItems in Queue

Reference : GUID
Specific Data:
First Name: UserFirstName1
Last Name: UserLastName1
Location: Location1

I want to convert this queueitems (there are many) to datatable, However, I need below fields
Reference, First Name and Last Name

There are solutions provided in the forum using Linq, but it is not fitting my requirement.

Can you share some ideas using LINQ queries?

Thanks
VJ

based on the following idea

we can extend to handle also QI Properties e.g. Reference

But lets keep in mind: The JSON DataTable gerneration will derive the DataColumn DataTypes by checking first row values. This can lead to unwanted datatype calculations.

But combining different approaches, done in projects came out to reliable results

Hi @vijayakumarkj
use build the data table and create a new data table with the columns required

Then for each row of queue items
USe 3 assign activities for reference,Firstname,Last name

then use item.SpecificContent(“Reference”).ToString() similarly for first name and last name… to get the values and use add data row to add these values into the data table.

Hope this will help.

@vijayakumarkj

please try this

first use build datatable and create a datatable with 3 columns and name it dt

dt = queueitems.Select(function(x) refdt.Rows.Add(New Object(){x.Reference,x.SpecificContent("FirstName").ToString,x.SpecificContent("LastName").ToString})).CopyToDataTable

Hope this helps

cheers

1 Like

@Gayathri_Mk It should work by adding individual line item to queue using a loop. I was looking for a LINQ query to get the results in data table and add to Queue via bulk upload. Thank you VJ!

Hi @ppr, I tried to extend your previous response to include Queue Item reference, however it wasn’t successful. Thank you VJ!

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