I am new in power automate. But the task I have is not trivial. So I have a bunch of files uploaded to onedrive. These are JSONs. Each json has a list of fields. looks like this:
{
"Fields": [
{
"FieldName": "Field1",
"FieldLabel": "File count",
"IsNull": false,
"ReadOnly": false,
"SystemField": true,
"Item": 1,
"ItemElementName": "Int"
},
{
"FieldName": "STOREDATETIME",
"FieldLabel": "Store Date",
"IsNull": false,
"ReadOnly": false,
"SystemField": true,
"Item": "/Date(1590068955000)/",
"ItemElementName": "DateTime"
},
{
"FieldName": "ZAHLUNGSZIEL",
"FieldLabel": "Zahlungsziel",
"IsNull": true,
"ReadOnly": false,
"SystemField": false,
"ItemElementName": "Date"
},
{
"FieldName": "DOCSIZE",
"FieldLabel": "Document Size",
"IsNull": false,
"ReadOnly": false,
"SystemField": true,
"Item": 16290480,
"ItemElementName": "Int"
}
],
"Flags": {
"IsCold": false,
"IsDBRecord": false,
"IsCheckedOut": false,
"IsCopyRightProtected": false,
"IsVoiceAvailable": false,
"HasAppendedDocuments": false,
"IsProtected": false,
"IsDeleted": false,
"IsEmail": false
},
"Links": [
{
"rel": "self",
"href": "/folder1/file7"
}
],
"Sections": [],
"ContentType": "application/pdf",
"HaveMoreTotalPages": false,
"HasTextAnnotation": false,
"HasXmlDigitalSignatures": false,
"AnnotationsPreview": false,
"TotalPages": 1,
"Id": 7,
"Title": "IMG_3827",
"LastModified": "/Date(1590068955000)/",
"LastModifiedSpecified": true,
"CreatedAt": "/Date(1590068955000)/",
"CreatedAtSpecified": true,
"FileSize": 16290480,
"SectionCount": 1,
"IntellixTrust": "None",
"VersionStatus": "Initial",
"FileCabinetId": "aaasss-dddfff-ggghhh"
}
The problem is that I have about 49 fields (the example is cut) and all these fields has different types, some are 'int' some are 'string'.
I used Parse JSON action with this schema:
{
"type": "object",
"properties": {
"Fields": {
"type": "array",
"items": {
"type": "object",
"properties": {
"FieldName": {
"type": "string"
},
"FieldLabel": {
"type": "string"
},
"IsNull": {
"type": "boolean"
},
"ReadOnly": {
"type": "boolean"
},
"SystemField": {
"type": "boolean"
},
"Item": {
"type": "any"
},
"ItemElementName": {
"type": "string"
}
},
"required": [
"FieldName",
"FieldLabel",
"IsNull",
"ReadOnly",
"SystemField",
"ItemElementName"
]
}
},
"Flags": {
"type": "object",
"properties": {
"IsCold": {
"type": "boolean"
},
"IsDBRecord": {
"type": "boolean"
},
"IsCheckedOut": {
"type": "boolean"
},
"IsCopyRightProtected": {
"type": "boolean"
},
"IsVoiceAvailable": {
"type": "boolean"
},
"HasAppendedDocuments": {
"type": "boolean"
},
"IsProtected": {
"type": "boolean"
},
"IsDeleted": {
"type": "boolean"
},
"IsEmail": {
"type": "boolean"
}
}
},
"Links": {
"type": "array",
"items": {
"type": "object",
"properties": {
"rel": {
"type": "string"
},
"href": {
"type": "string"
}
},
"required": [
"rel",
"href"
]
}
},
"Sections": {
"type": "array"
},
"ContentType": {
"type": "string"
},
"HaveMoreTotalPages": {
"type": "boolean"
},
"HasTextAnnotation": {
"type": "boolean"
},
"HasXmlDigitalSignatures": {
"type": "boolean"
},
"AnnotationsPreview": {
"type": "boolean"
},
"TotalPages": {
"type": "integer"
},
"Id": {
"type": "integer"
},
"Title": {
"type": "string"
},
"LastModified": {
"type": "string"
},
"LastModifiedSpecified": {
"type": "boolean"
},
"CreatedAt": {
"type": "string"
},
"CreatedAtSpecified": {
"type": "boolean"
},
"FileSize": {
"type": "integer"
},
"SectionCount": {
"type": "integer"
},
"IntellixTrust": {
"type": "string"
},
"VersionStatus": {
"type": "string"
},
"FileCabinetId": {
"type": "string"
}
}
}
I have modified it a bit, you can see it in bold. After that I need to update the Dynamics CRM record, so that all the fields in Custom Entity are set according to JSON.
But I stuck. I don't know how should I iterate