Type of DataTable for Sharepoint Get List Iteams activity

I’m having trouble with the output Variable as my dataTable doesn’t seem to capture the data of my columns in my SharePoint List.

I’m using the Sharepoint Get List Items
It gets access to my list and I can choose what items to retrieve, However, the DataTable is empty, my string variables that are suppose to capture the items within the columns = null.
Tried reading; Activities - Get List Items (uipath.com) but didn’t find my answer.

I’m thinking this has to do with my output, my type of argument, but can’t figure out what it is.

@OGunnarsson,

Datatable datatype is correct. There might be issue of other configuration of the activity. If you can share more details on how you configured it will be helpful to understand your issue.

1 Like

Message: Column “Name of a column that’s checked within the activity” does not belong to table DataTable4. Exception type: System.ArgumentException

24.10.4-beta.17693+Branch.release-v24.10.4.Sha.23194d406b66452fd1dd41226b57a4ce8b842719.23194d406b66452fd1dd41226b57a4ce8b842719

Source: For Each currentDataRow

Message: Column ‘I remove the correct name here for privacy reasons’ does not belong to table DataTable4.

Exception Type: System.ArgumentException

System.ArgumentException: Column ‘RemovedName’ does not belong to table DataTable4. at System.Data.DataRow.GetDataColumn(String columnName)
at System.Data.DataRow.get_Item(String columnName)
at Namespace_5b6b.Main_Expressions.Main_Expressions_TypedDataContext2_ForReadOnly._Closure$__._Lambda$__17-0(DataRow currentItem)
at System.Linq.Enumerable.SelectEnumerableIterator2.MoveNext() at UiPath.Core.Activities.ForEachBase1.InternalExecute(NativeActivityContext context)
at UiPath.Core.Activities.ForEachBase`1.StartLoop(NativeActivityContext context)
at UiPath.Core.Activities.InterruptibleLoopBase.Execute(NativeActivityContext context)
at System.Activities.NativeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

After the Get List Items activity I run a log message with; String.Join(“,”, sharepointListItems.Columns.Cast(Of System.Data.DataColumn)().Select(Function(c) c.ColumnName)) and it logs my string variables as null

@OGunnarsson,

Are you initializing the datatable before Get List Items? If yes, then that s the problem. The activity returns a dynamic datatable, means the columns and their order varies lists to list.

1 Like

Get List Items in my first activity in this flow

I’m not reluctant to share info, just need to be careful with my content.
So please let me know if I need to give more info, i’m still learning. :slight_smile:

I’m still cold on this one if anyone can help me figure this out. I don’t seem to get the data from my sharepoint columns.

@OGunnarsson

  1. Did yoi happen to give any filter?
  2. Did you mention any columns names in the columsn field as input?
  3. Just to check canyou try with for each liat item activity to check if the connectivity with list is proper

Cheers

1 Like
  1. I did not give it a filter, should I be filtering?
  2. Column names to retrive do appear in the drop down and I check the ones I need for this application.
  3. Next step is for each, with this expression in the input
    → sharepointListItems.AsEnumerable().Select(Function(currentItem) New With { .Column1 = currentItem(“Column1”).ToString(), .Column2 = currentItem(“Column2”).ToString(), .Column3 = currentItem(“Column3”).ToString(), .Column4 = currentItem(“Column4”).ToString() })

I changed the column names to numbers for posting, they have other names then 1,2,3 and 4.

@OGunnarsson

  1. First is the datatable output having rows can you do dt.rowcount first
  2. Also to loop you can use for eqch row in datatable

What for each is this for?

Cheers

Sorry for late reply, I had to put my project on ice for other metters. I’m back at it now.

image

image

It appears that my variables strings don’t fetch the data from the sharepointlist/data table and I’m still at a complete loss as to why that might be.

for each activity is to assign each client detail into a string, this process is loggin into a service site and checking if data has been submitted and sending a report of project status based on that data. I’m trying to have it log into for each client and collecting the information I need.

@OGunnarsson

Are you saying the datatable is null?

As per screenshot the datatable varible has only datatable13 column or vaue in it which is not expected

Please show properties of getlist items

Cheers

Perhaps i’m missing something, I have to refresh on my for each usage,

here are the properties of getlist items

@OGunnarsson

I dont see any issue…looks like you are on latest version of o365

here when as datatable it is displaying something else but when you convert to string I can see few columns

image

cheers

Then my problem is elswhere, back to the drawing board!

Thank you for your time

1 Like

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