Sync list data type field data from custom table to the sharepoint list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello,
I have a use case where I have to sync the data from the ServiceNow custom m table to the share point list item. To achieve this I have used the existing Microsoft sharepoint online spoke and the OOB action "Update list item by ID". Where I have some issue in updating the data for "working system" filed of type choice (which accepts the multiple values) in the sharepoint list. In the custom table the working system field is of type list and I have configured the choices in the sys choice table. The real issue is I face some challenges in setting up the input variable is the action. For the field of type choice I can configure the input but for the type List I can't because of this I can't update the data to the sharepoint list. So It would be great if could assist me on this matter. Let me know if there is an alternate way for this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @vmanojkumar
ServiceNow -> Working System -> Type: List -> this means comma separated values.
Flow consider this as one string not array: u_working_system = Jan,Feb,Mar
SharePoint -> Working System -> Type: Choice -> As per google search, SharePoint choice columns store data as text strings (single-select) or arrays of strings (multi-select)like ["Jan", "Feb", "Mar"],
So, you need to add below script in Flow Action to send the data in the format which SharePoint Choice type accepts:
(function execute(inputs, outputs) {
// inputs.working_system = "sap,crm,wms"
outputs.workingSystemArray =
inputs.working_system
.split(',')
.map(function(v) {
return v.trim();
});
})(inputs, outputs);
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Which data type should I use for the working system input variable? Currently, I have set it as a string because I was unable to reference the sys_choice table in the working system input variable, since it's a list type. However, when the variable is set to string, the flow cannot retrieve the value from the field.