How To Add Person Or Group Data Type Column To A Sharepoint List Using "Add List Items Activity"?

How to add a "Person or Group" data type column from "Add List Items activity" to an Office 365 SharePoint List?

Issue Overview:

When adding "Person or Group" data type columns to a SharePoint list within the workflow being developed, then the following error is displayed.

image.png


Root Cause:

  1. The data format for the columns in the DataTable differs from 'Object.' It's a common mistake to use data types such as String, Integer, or PersonOrGroupColumn.
  2. Microsoft Office 365 treats 'Person or Group' items within the organization (including SharePoint lists) as integers. A common error is attempting to use email addresses for this purpose.



Resolution:

How to successfully add data from the Add List Items activity to an Office 365 SharePoint List?
To avoid this error and be able to add any kind of data to an Office 365 SharePoint List, format the DataTable from the Build Data Table active as shown below:

  1. Add a new Build Data Table activity to the workflow
  2. When building the DataTable, create all the columns with "Object" as the data type
  3. In the first row, add the column names as they're in your SharePoint List. Also, add them in the same order
image.png
  1. Add the desired data to the DataTable starting from the second row (row #1). **Do not include double quotes("") when adding text**
  2. Run the process
  3. Check if the data was added to the SharePoint List.
image.png


Additional Information:
  • Figure how to handle the Microsoft ID assigned to the Organization Users since this is out of UiPath Control
  • Default values are not allowed from the Build Data Table activity
  • It is possible to obtain the Microsoft Office 365 person ID by adding the person manually to the SharePoint list and using the web browser inspect tools to see the API call and its response information.