Add Item
Overview This custom SharePoint workflow activity is designed to add a new item to a specified SharePoint list. The activity requires key parameters such as the connector, the target SharePoint list, and the field values for the new item. Additionally, it supports optional parameters like content type and folder. These optional parameters allow for greater flexibility but are not necessary for the activity to function.
Required parameters:
- Connector- connector field type of MSGraph or the current user.
- SharePoint list - the list is selected using a lookup. This identifies the target list where the item will be created. The list must exist, and the connector must have the necessary permissions to access it.
- Field values - This parameter is used to populate the fields of the new item with specific values. Ensure that the field names match exactly with the SharePoint list's schema.
Optional parameters:
- Content type In this parameter you can select the type of content. You can also leave the field blank then the content type will have a default value.
- Folder In this parameter, select lookup to folder in the SharePoint list to specify the folder in which the item should be placed. If the list contains folders, specify the folder where the item should be placed. If not specified, the item will be added to the root folder of the list.
The user can also assign output parameters by selecting a workflow variable, which will receive the identifier of the new item.
Item Creation: The activity creates a new item in the specified SharePoint list. If the Content Type is provided, it is applied to the new item; otherwise, the list’s default content type is used. If a Folder is specified, the item is added to that folder; otherwise, it is added to the root of the list. The fields of the new item are populated using the provided Field Values dictionary.
Error Handling: If the item cannot be added to the list due to issues like invalid field names, missing permissions, or list not found, the activity logs the error and terminates the workflow.
Success Logging: Upon successful creation of the item, the activity logs a confirmation message in the workflow history.