I have a batch API that is pulling staff information from our school management system. The API call works well in other applications, but in Power Automate there's something strange going on.
When running the flow, it gives me an error that the MiddleName field is expecting a string, but returning a null. In the dataset, there are some teachers with no middle name listed, so the field is null. This is making the flow fall over, but I am not sure how to fix this step.
I am looking to send the output from this into a Microsoft List so that teachers can look up the contact details of other staff (apparently looking in Outlook or the school management system is too hard for them, so maybe this will work for them...)
Below is JSON Schema based on the sample I provided to the flow from the sample.
{
"type": "object",
"properties": {
"iSAMS": {
"type": "object",
"properties": {
"HRManager": {
"type": "object",
"properties": {
"CurrentStaff": {
"type": "object",
"properties": {
"StaffMember": {
"type": "array",
"items": {
"type": "object",
"properties": {
"@@Id": {
"type": "string"
},
"@@PersonId": {
"type": "string"
},
"@@PersonGuid": {
"type": "string"
},
"Initials": {
"type": "string"
},
"UserCode": {
"type": "string"
},
"Title": {
"type": "string"
},
"Forename": {
"type": "string"
},
"MiddleNames": {
"type": "string"
},
"Surname": {
"type": "string"
},
"FullName": {
"type": "string"
},
"NameInitials": {
"type": "string"
},
"PreferredName": {
"type": "string"
},
"Salutation": {
"type": "string"
},
"DOB": {
"type": "string"
},
"Gender": {
"type": "string"
},
"SchoolEmailAddress": {
"type": "string"
},
"SchoolMobileNumber": {},
"PersonalMobileNumber": {},
"TeachingStaff": {
"type": "string"
},
"Divisions": {
"type": "object",
"properties": {
"Division": {
"type": "array",
"items": {
"type": "object",
"properties": {
"@@Id": {
"type": "string"
},
"Name": {
"type": "string"
}
},
"required": [
"@@Id",
"Name"
]
}
}
}
},
"Roles": {
"type": "object",
"properties": {
"Role": {
"type": "object",
"properties": {
"@@Id": {
"type": "string"
},
"Name": {
"type": "string"
}
}
}
}
},
"PreviousMISId": {
"type": "string"
},
"UserName": {
"type": "string"
},
"LeavingDate": {
"type": "string"
}
},
"required": [
"@@Id",
"@@PersonId",
"@@PersonGuid",
"Initials",
"UserCode",
"Title",
"Forename",
"Surname",
"FullName",
"NameInitials",
"PreferredName",
"Salutation",
"DOB",
"Gender",
"SchoolEmailAddress",
"SchoolMobileNumber",
"TeachingStaff",
"Divisions"
]
}
}
}
}
}
}
}
}
}
}