
Hello there.
I'm trying to copy elements from a sharepoint list to another. The list is compodes by almost 6000 rows, ID from 9000 to 14000. I've reached this with a simple automation using "Get Items" and "edit item" methods, but as you know with this way the Author would be the owner of the automation, same issue with all default fileds of a list.
My issue at the moment is to edit the writeonly default columns (Author, creation_date, ecc) with original values.
I've found this video:
But I've some problems with the PARSE JSON block.
I've put as sample the body of the http request, the Uri is composed with this filter:
/items?$top=3000&$filter=ID lt '11780'
but the error says that the schema validation failed. If I check the output, the result is:
{
"errors": [
{
"message": "Invalid type. Expected String but got Null.",
"lineNumber": 0,
"linePosition": 0,
"path": "d.results[2].Risolto_x0020_alle",
"schemaId": "#/properties/d/properties/results/items/properties/Risolto_x0020_alle",
"errorType": "type",
"childErrors": []
}
Thi is the output body from the GET HTTP REQUEST. It is based on 1 element only:
{
"d": {
"results": [
{
"__metadata": {
"id": "95cbdc99-0776-4b8e-881f-e0e67161c8ee",
"uri": "mycompanysite_api/Web/Lists(guid'8f30f4dc-d3bd-4b5f-b6c3-4764e8002a48')/Items(11778)",
"etag": "\"2\"",
"type": "SP.Data.AndonListItem"
},
"FirstUniqueAncestorSecurableObject": {
"__deferred": {
"uri": "mycompanysite_api/Web/Lists(guid'8f30f4dc-d3bd-4b5f-b6c3-4764e8002a48')/Items(11778)/FirstUniqueAncestorSecurableObject"
}
},
"RoleAssignments": {
"__deferred": {
"uri": "mycompanysite_api/Web/Lists(guid'8f30f4dc-d3bd-4b5f-b6c3-4764e8002a48')/Items(11778)/RoleAssignments"
}
},
"AttachmentFiles": {
"__deferred": {
"uri": "mycompanysite_api/Web/Lists(guid'8f30f4dc-d3bd-4b5f-b6c3-4764e8002a48')/Items(11778)/AttachmentFiles"
}
},
"ContentType": {
"__deferred": {
"uri": "mycompanysite_api/Web/Lists(guid'8f30f4dc-d3bd-4b5f-b6c3-4764e8002a48')/Items(11778)/ContentType"
}
},
"GetDlpPolicyTip": {
"__deferred": {
"uri": "mycompanysite_api/Web/Lists(guid'8f30f4dc-d3bd-4b5f-b6c3-4764e8002a48')/Items(11778)/GetDlpPolicyTip"
}
},
"FieldValuesAsHtml": {
"__deferred": {
"uri": "mycompanysite_api/Web/Lists(guid'8f30f4dc-d3bd-4b5f-b6c3-4764e8002a48')/Items(11778)/FieldValuesAsHtml"
}
},
"FieldValuesAsText": {
"__deferred": {
"uri": "mycompanysite_api/Web/Lists(guid'8f30f4dc-d3bd-4b5f-b6c3-4764e8002a48')/Items(11778)/FieldValuesAsText"
}
},
"FieldValuesForEdit": {
"__deferred": {
"uri": "mycompanysite_api/Web/Lists(guid'8f30f4dc-d3bd-4b5f-b6c3-4764e8002a48')/Items(11778)/FieldValuesForEdit"
}
},
"File": {
"__deferred": {
"uri": "mycompanysite_api/Web/Lists(guid'8f30f4dc-d3bd-4b5f-b6c3-4764e8002a48')/Items(11778)/File"
}
},
"Folder": {
"__deferred": {
"uri": "mycompanysite_api/Web/Lists(guid'8f30f4dc-d3bd-4b5f-b6c3-4764e8002a48')/Items(11778)/Folder"
}
},
"LikedByInformation": {
"__deferred": {
"uri": "mycompanysite_api/Web/Lists(guid'8f30f4dc-d3bd-4b5f-b6c3-4764e8002a48')/Items(11778)/LikedByInformation"
}
},
"ParentList": {
"__deferred": {
"uri": "mycompanysite_api/Web/Lists(guid'8f30f4dc-d3bd-4b5f-b6c3-4764e8002a48')/Items(11778)/ParentList"
}
},
"Properties": {
"__deferred": {
"uri": "mycompanysite_api/Web/Lists(guid'8f30f4dc-d3bd-4b5f-b6c3-4764e8002a48')/Items(11778)/Properties"
}
},
"Versions": {
"__deferred": {
"uri": "mycompanysite_api/Web/Lists(guid'8f30f4dc-d3bd-4b5f-b6c3-4764e8002a48')/Items(11778)/Versions"
}
},
"FileSystemObjectType": 0,
"Id": 11778,
"ServerRedirectedEmbedUri": null,
"ServerRedirectedEmbedUrl": "",
"ContentTypeId": "0x0100CC2808497B80344298439E89856F85DB",
"Title": "PRODUZIONE",
"ComplianceAssetId": null,
"Sottotipo": "PARAMETRI",
"Risolto_x0020_alle": "2023-09-15T09:56:55Z",
"Descrizione_x0020_testo": "Fermo impianto per film attaccamento sul master",
"Preso_x0020_in_x0020_carico_x002Id": null,
"Preso_x0020_in_x0020_carico_x002StringId": null,
"Sottotipo_x0020_materiale": null,
"Preso_x0020_in_x0020_carico_x0020": null,
"Risolto_x0020_da": "Linea 8 Cast",
"Nomecognome": "COGNOME NOME",
"Created": "2022-12-15T02:43:24Z",
"Anno": "2022",
"Mese": "12.0000000000000",
"Modified": "2023-09-15T09:56:56Z",
"OData__ColorTag": null,
"AuthorId": 167,
"Soluzioniapplicate": null,
"Reparto": null,
"Data_x002f_orainiziomanutenzione": null,
"Manutentorediriferimento": null,
"Zonaimpianto": null,
"TipoIntervento": null,
"ID": 11778,
"EditorId": 167,
"OData__UIVersionString": "1.0",
"Attachments": false,
"GUID": "42b59724-d686-42bb-a0ff-70b521114e6e"
}
]
}
}
It seems that the problem appears when the flow finds a nell value.
Actually, the field "Risolto_x0020_alle" Could be empty for some rows, the column is type text.
Do you have some suggestion to manage this?
Thanks.
Guys I've solve this.
In the Schema GENERATED BY our example, we should find something like:
...................
"Id": {
"type": "integer"
},
"ServerRedirectedEmbedUri": {},
"ServerRedirectedEmbedUrl": {
"type": "string"
},
"ContentTypeId": {
"type": "string"
},
"Title": {
"type": "string"
},
"ComplianceAssetId": {},
"Sottotipo": {
"type": "string"
},
"Risolto_x0020_alle": {
"type": ["string","null"]
},
........................
Simply, in the fields where we can accept null values, change the type from this:
"type": "string"
to this:
"type": ["string","null"]