web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Cannot get ID from API Response

(0) ShareShare
ReportReport
Posted on by 40

Hi,

We used a great deal of api calls for our dynamics365 business central solution. However I cannot find any way of returning the ids of records for updating. 

The power automate methods for updating records require a guid/documentid, however there seems to be absolutely no way to expose this data.

When getting purchase orders by get api or creating a new purchase order by post api, the response brings back no ids, guids or anything to that description:

GET api.businesscentral.dynamics.com/.../Purchase_Order

would bring back:

"value": [
        {
            "@odata.etag""etag....",
            "Document_Type""Order",
            "No""00000",
            "Buy_from_Vendor_No""V00000",
            "Buy_from_Vendor_Name": "Name",
.........
}....]
Any ideas on how to expose the id's of records? It seems quite ludicrous that even the power automate business central features don't have any way of doing this either!
I need to get this value to create purchase order lines, it's a required field which is seemingly impossible to get dynamically.
I have the same question (0)
  • Lars Lohndorf-Larsen Profile Picture
    on at

    Hello,

    If you look at page 5527 for example:

    ===

    page 5527 "Purchase Invoice Entity"

    {

       Caption = 'purchaseInvoices', Locked = true;

       ChangeTrackingAllowed = true;

       DelayedInsert = true;

       EntityName = 'purchaseInvoice';

       EntitySetName = 'purchaseInvoices';

       ODataKeyFields = Id;

       PageType = API;

       SourceTable = "Purch. Inv. Entity Aggregate";

       layout

       {

           area(content)

           {

               repeater(Group)

               {

                   field(id; Id)

                   {

                       ApplicationArea = All;

                       Caption = 'id', Locked = true;

                       Editable = false;

    ===

    Call:

    Make an API call to this page gives you both e.tag and ID:

    GET api.businesscentral.dynamics.com/.../purchaseInvoices

    Response:

    {

       "@odata.context": "api.businesscentral.dynamics.com/.../$metadata

       "value": [

           {

               "@odata.etag": "W/\"JzQ0Ozl5cERqUnUzNDB4ZnVsR3NNMGh4THNZQk9oR21oek5mTys4ekd1ZXEvWFU9MTswMDsn\"",

               "id": "85b2141f-b0fd-ea11-bb48-000d3a2fece2",

               "number": "108001",

               "invoiceDate": "2019-01-01",

               "postingDate": "2019-01-01",

               "dueDate": "2019-01-01",

    I don't know if this is the type of ID you are looking for?

  • RayFoster Profile Picture
    40 on at

    Thank you for your response.

    It's clear that I've been using a different API endpoint that doesn't expose the id data. I tested the endpoint you sent and I did receive the ids however that was for a completely different table (purchaseInvoices). I'm looking at getting the id field available from purchaseOrders. I now get this response from the api:

    {

       "error": {

           "code": "Application_DialogException",

           "message": "Data required by the API was not set up. To set up the data, invoke the action from the API Setup page.

       }

    }

    I've tried setting api up from api setup page, but still no dice unfortunately.

  • Suggested answer
    JAngle Profile Picture
    133 on at

    Just use the standard api page but with the http connector in power automate. Then you can loop through the results and use the BC connector as you wish. Similar pattern followed here: joshanglesea.wordpress.com/.../

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,785

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,007 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 948 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans