Posting data to Business Central

Kayode Ogidan 60 Reputation points
2024-05-14T19:28:10.83+00:00

Hello I am having the following error, what is the right way to post data to Dynamics 365 Business Central, I am current making a post request in my data flow using the external call option, in my dataflow, something is off because I have not been able to make this post request, been working on this for weeks, please help.Current data flow looks like this
Screenshot 2024-05-14 152238 I am comparing the address name from the source and the address name from the look up dataset to create a macthed_url derived column, but my data is not posting to the temp table I created in Business Central. In Business central, I created an api page type API, which I specified in the AL code, but for some reason in the external call in the data flow, I get error 404 in each row of the external call.

Job failed due to reason: Error response from server: Some({"error":{"code":"BadRequest","message":"An unexpected instance annotation name 'No.' was found when reading from the JSON reader, In OData, Instance annotation name must start with @. CorrelationId: 57b9d51c-238b-4e51-af4a-648e502a87ed."}}), Status code: 400. Please check your request url and body. (url:https://api.businesscentral.dynamics.com/v2.0/be8cd747-0b4b-4f5f-91d5-2c9b3a1b770d/SandboxDev03_28_2024/ODataV4/Company('DF%20One%20Operator%20LLC')/PurchaseLinesTempTable,request body: Some({"No.":"65120","Description":"Yansanido Spiral Notebook, 4 Pcs A5 Thick Plastic Hardcover 8mm Ruled 4 Color 80 Sheets -160 Pages Journals for Study and Notes (Light Pink,Light Green,Light Blue,ivory, A5 5.7" x 8.3"-Ruled) (B09FFZGH5V)","Quantity":"1","Direct Unit Cost Excl. Tax":"10.58","Line Amount Excl. Tax":"10.58","Department Code":"500","Matched_Relative_URL":"Company('DF One Operator LLC')/PurchaseLinesTempTable"}), request method: POST)

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,773 questions
Dynamics 365 Training
Dynamics 365 Training
Dynamics 365: A Microsoft cloud-based business platform that provides customer relationship management and enterprise resource planning solutions.Training: Instruction to develop new skills.
83 questions
{count} votes

1 answer

Sort by: Most helpful
  1. phemanth 6,810 Reputation points Microsoft Vendor
    2024-05-15T05:20:40.0166667+00:00

    @Kayode Ogidan

    Thanks for using MS Q&A platform and posting your query.

    The error message you're getting "An unexpected instance annotation name 'No.' was found when reading from the JSON reader" indicates an issue with the structure of your JSON request body. In OData, instance annotation names must start with "@".

    Here are some steps you can take to troubleshoot the issue:

    Check the schema definition of your PurchaseLinesTempTable in Business Central: Make sure the field you're referring to as "No." is actually a field in the table and not an annotation. If it's an annotation, remove it from your JSON payload.

    Ensure proper JSON formatting: Double-check that your JSON data is formatted correctly. There should be no extraneous characters or quotes around the field names. Use a JSON formatter or validator to ensure your JSON is well-formed.

    • Verify casing: Be cautious of casing in your field names. OData is case-sensitive, so make sure the field names in your JSON payload match the casing of the fields in your Business Central table.
    • Error 404 in External Call in Data Flow: This error usually indicates that the server could not find the requested resource. In the context of Azure Data Factory, it could mean that the URL or the body of the request is not correctly formed. You can try to use the “Import projection” in the Output tab of the external call transformation. Azure Data Factory will automatically detect the schema of the API call and the Body type expression will be auto filled.
    • Unexpected Instance Annotation Name ‘No.’ Error: This error typically occurs when there is incorrect Dynamic content referenced In OData, Instance annotation name must start with @. You might want to check the request body and ensure that the instance annotation names are correctly formatted.

    Here are some additional resources that you might find helpful:

    If you're still having trouble after following these steps, please do let us know.

    0 comments No comments