Share via

Document Intelligence Extract

Anonymous
2025-11-16T15:56:58.8266667+00:00

Hello Support Team,

We have an issue while adding records in Business Central Create Records in worksheet API

We have successfully triggered a workflow on receiving Purchase Order PDF
directed flow to use Customer Specific Trained Model in Customer Intelligence Extract Model
it return 202 and then GET Do Until Loop succeeded and we got ParsedResult

While creating records in business central which add all records as Headers + Lines in single row

Flow succeed - all greens, but no records
On inspection, we noticed Apply to each is not opening up, not receiving data in mapped fields

Could be the Schema issue from ParsedResult ?

Looking for your support at this last step to close this task

Please suggest the best way forward

Sharing below the Schema for ParsedResult [Parse JSON] after GET Call succeeded from Extract Model call

{
    "type": "object",
    "properties": {
        "result": {
            "type": "object",
            "properties": {
                "documents": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "fields": {
                                "type": "object",
                                "properties": {
                                    "PONumber": {
                                        "type": "object",
                                        "properties": {
                                            "valueString": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "PODate": {
                                        "type": "object",
                                        "properties": {
                                            "valueString": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "DueDate": {
                                        "type": "object",
                                        "properties": {
                                            "valueString": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "POTotal": {
                                        "type": "object",
                                        "properties": {
                                            "valueCurrency": {
                                                "type": "object",
                                                "properties": {
                                                    "amount": {
                                                        "type": "integer"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "CustomerName": {
                                        "type": "object",
                                        "properties": {
                                            "valueString": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "Terms": {
                                        "type": "object",
                                        "properties": {
                                            "valueString": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "ITEM": {
                                        "type": "object",
                                        "properties": {
                                            "valueString": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "UofM": {
                                        "type": "object",
                                        "properties": {
                                            "valueString": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "Quantity": {
                                        "type": "object",
                                        "properties": {
                                            "valueInteger": {
                                                "type": "integer"
                                            }
                                        }
                                    },
                                    "Cost": {
                                        "type": "object",
                                        "properties": {
                                            "valueCurrency": {
                                                "type": "object",
                                                "properties": {
                                                    "amount": {
                                                        "type": "integer"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "Amount": {
                                        "type": "object",
                                        "properties": {
                                            "valueCurrency": {
                                                "type": "object",
                                                "properties": {
                                                    "amount": {
                                                        "type": "integer"
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "Email": {
                                        "type": "object",
                                        "properties": {
                                            "valueString": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "Currency": {
                                        "type": "object",
                                        "properties": {
                                            "valueString": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "Classes": {
                                        "type": "object",
                                        "properties": {
                                            "valueArray": {
                                                "type": "array",
                                                "items": {
                                                    "type": "object",
                                                    "properties": {
                                                        "ClassName": {
                                                            "type": "object",
                                                            "properties": {
                                                                "valueString": {
                                                                    "type": "string"
                                                                }
                                                            }
                                                        },
                                                        "Amount": {
                                                            "type": "object",
                                                            "properties": {
                                                                "valueCurrency": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "amount": {
                                                                            "type": "integer"
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    },
                                                    "required": [
                                                        "ClassName",
                                                        "Amount"
                                                    ]
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        },
                        "required": [
                            "fields"
                        ]
                    }
                }
            }
        }
    }
}
Azure Document Intelligence in Foundry Tools

Answer accepted by question author

Anshika Varshney 11,565 Reputation points Microsoft External Staff Moderator
2025-11-18T05:26:48.62+00:00

Hi Rajesh Lohana

Thanks for sharing the details and JSON schema that helps a lot.

Here are a few steps to try, based on what you described:

  1. Validate the ParsedResult Structure
    • After your GET call from the Extract (trained) model, inspect the actual output JSON. Sometimes what you think the schema is and what the service returns can differ.
    • Make sure that the fields you map in Business Central (BC) exactly match the JSON structure, including nested paths. For example, if PONumber is under result → documents[0] → fields → PONumber → valueString, then your “Apply to each” / mapping logic in Power Automate should navigate the same path.
  2. Check the “Apply to Each” Logic
    • It seems “Apply to each” is not “opening up,” which likely means the array you're looping over is either empty or not being referenced correctly. Confirm that you’re iterating over the correct array in the parsed JSON (e.g., documents array).
    • If documents is empty, that means Document Intelligence might not be detecting any document data which could either be a parsing issue or a problem earlier in the flow.
  3. Schema Mapping in Power Automate / Logic Apps
    • When you do “Parse JSON” in Power Automate, ensure the schema in that action exactly matches the shape of ParsedResult. If there’s a mismatch, subsequent steps (like Apply to each) will not receive the data as expected.
    • Sometimes, using a dynamic schema (i.e., fewer “type” constraints) helps you debug: first you log the raw ParsedResult, then build up a stricter schema only once you're confident about the structure.
  4. Logging / Debugging
    • Add a “Compose” / “Log” action right after the GET call, so you can dump the ParsedResult and visually inspect it in each run.
    • This will help you verify what data is actually coming back, and how to correctly point to fields for the BC “Create Records” mapping.

Why this could be happening (context):

  • Document Intelligence returns a nested JSON structure; if your mapping doesn’t exactly match, data won't flow into Power Automate’s loop correctly.
  • The schema you defined for “Parse JSON” must match the real response — even small mismatches (like using valueString vs valueInteger) will break downstream logic.

If you are still facing the issue, please share your error details, your current flow configuration, and the raw ParsedResult (with sensitive info removed) so the community can help you more accurately.

Thankyou!

Was this answer helpful?

1 person found this answer helpful.

Answer accepted by question author

AI answer

2025-11-16T15:57:13.28+00:00

It sounds like you're experiencing an issue with the data mapping from the ParsedResult to the Business Central Create Records API. Here are a few steps you can take to troubleshoot the problem:

  1. Check the Schema: Ensure that the schema you are using in your Apply to Each action matches the structure of the ParsedResult. The fields in your schema should correspond to the properties in the ParsedResult JSON. For example, if you're trying to access PONumber, make sure you're referencing it correctly in your mapping.
  2. Inspect the ParsedResult: After the GET call, inspect the actual output of the ParsedResult to confirm that it contains the expected data. If the data is not present or is structured differently than expected, this could be the reason why the Apply to Each is not functioning as intended.
  3. Debugging: Add logging or debugging steps to your flow to capture the output of the GET call and the data being passed into the Apply to Each action. This will help you identify if the data is being processed correctly.
  4. Mapping Fields: Ensure that you are correctly mapping the fields from the ParsedResult to the corresponding fields in Business Central. For instance, if PONumber is nested within fields, your mapping should reflect that hierarchy.
  5. Review Error Messages: If there are any error messages or warnings in your flow, review them as they may provide additional context on what might be going wrong.

If after these checks the issue persists, it may be beneficial to reach out to Microsoft support for more specific guidance, especially if it seems like a schema-related issue.


References:

AI-generated content may be incorrect. Read our transparency notes for more information.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.