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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Consume json from external system

(1) ShareShare
ReportReport
Posted on by 451
Hi ,
 
I need to consume json from external system but the json is not in the format we generally have when trying to import it through custom service.
I have pasted the sample json below, can you suggest if we can import the same using custom service or we need a middleware to format this for F&O format json.
 
{    /schemaVersion/: /5.0.0/,    /id/: /ID-TEST01-TR-el/,    /lastModified/: /2024-04-04T12:00:09.000+00:00/,    /traceId/: /25rt2fdc-662-41f0-94ec-e21rr485/,    /eventType/: /xyz/,    /eventTime/: /2024-04-29T12:38:28.9637814+00:00/,    /filter/: {        /contentabc/: [            /xyz/        ]    },    /delta/: true,    /data/: {        /itemNo/: /TEST01/,        /itemType/: /TYPE1/,        /countryCode/: /GR/,        /languageCode/: /el/,        /latestUpdate/: /2024-04-04T12:00:09.000+00:00/,        /productType1/: {            /productTypeNo/: /10045/,            /productTypeName/: /ABC/,            /updateDate/: /2020-06-02T11:16:25.000+00:00/        },        /productName1/: [            {                /productNameNo/: /1003/,                /sortNo/: 1,                /updateDate/: /2017-12-12T18:32:28.000+00:00/            }        ],        /businessStructureLocal/: [            {                /validFrom/: /1998-09-01T00:00:00.000+00:00/,                /validTo/: /2000-08-31T23:59:59.000+00:00/,                /Name/: /TEST01/            }        ]    }}
Thanks!!
I have the same question (0)
  • Suggested answer
    Anthony Blake Profile Picture
    2,972 Super User 2025 Season 2 on at
    If looks like you have 3 options:
     
    1. Modify your current custom service to process the new format, or;
    2. Create a custom service to process the new format, or;
    3. Pre-process the data into the format required by your current customer service - potentially in something like a logic app
     
     
  • Dev Profile Picture
    451 on at
    Hi Anthony,
     
    We still haven't developed the custom service and only received the sample json file but not sure if we can use this as is for our custom services development or we need to transform this to adapt to F&O json requirements.
  • Layan Jwei Profile Picture
    8,133 Super User 2025 Season 2 on at
    Hi,


    you said this format doesn't match the format you generally have. What is the format you are expecting?
    and what do you mean by it doesn't match F&O json requirements? you can build your custom service in any way to accept the json you are getting.

    Or are you referring to this one?

        "contentabc":
        [
          "xyz"
        ]

    shouldn't it be like this?
        "contentabc":
        [
          "Field1" :"xyz"
        ]
  • Suggested answer
    Anthony Blake Profile Picture
    2,972 Super User 2025 Season 2 on at
    Hi Dev,
     
    If the service isn't done yet sure you can process json so long as it is in a valid format. Its probably an issue with your paste, but it currently contains a bunch of errors if run through a validator for example here https://jsonformatter.curiousconcept.com/
     
    You really need a json schema to go with your sample from the provider which you can developer against, but if thats not possible you can generate one using sites like this one: https://transform.tools/json-to-json-schema
     
    Alternatively, you could add some pre-processing with a Logic App and/or Azure Function, to transform your data and load through OData, Rest API, or Recurring integrations.
     
  • Martin Dráb Profile Picture
    238,069 Most Valuable Professional on at
    Let me repost the code to make it easier to read.
    {
        "schemaVersion": "5.0.0",
        "id": "ID-TEST01-TR-el",
        "lastModified": "2024-04-04T12:00:09.000+00:00",
        "traceId": "25rt2fdc-662-41f0-94ec-e21rr485",
        "eventType": "xyz",
        "eventTime": "2024-04-29T12:38:28.9637814+00:00",
        "filter": {
            "contentabc": ["xyz"]
        },
        "delta": true,
        "data": {
            "itemNo": "TEST01",
            "itemType": "TYPE1",
            "countryCode": "GR",
            "languageCode": "el",
            "latestUpdate": "2024-04-04T12:00:09.000+00:00",
            "productType1": {
                "productTypeNo": "10045",
                "productTypeName": "ABC",
                "updateDate": "2020-06-02T11:16:25.000+00:00"
            },
            "productName1": [
                {
                    "productNameNo": "1003",
                    "sortNo": 1,
                    "updateDate": "2017-12-12T18:32:28.000+00:00"
                }
            ],
            "businessStructureLocal": [
                {
                    "validFrom": "1998-09-01T00:00:00.000+00:00",
                    "validTo": "2000-08-31T23:59:59.000+00:00",
                    "Name": "TEST01"
                }
            ]
        }
    }
    At the first glance, I don't see anything that you couldn't build a custom service for, although a transformation could make processing in F&O easier.
     
    Top-level elements such as schemaVersion or data would be parameters of the custom service methods. Then you would need contract classes for JSON objects (such as the value of data).
  • Dev Profile Picture
    451 on at
    So the data sent by json has more than 100 fields but we need just around 20 of them so is it a good idea to use a middleware to transform the json to only send the data that we need.
     
    Also , can we use DMF for processing this json in anyway as I don't see the json format in the supported formats.
     
    Thanks!
  • Martin Dráb Profile Picture
    238,069 Most Valuable Professional on at
    No, you can't use DMF to import JSON and you can't use any arbitrary format there - you must respect the format from the data entity. Therefore you'd need a transformation.
  • Dev Profile Picture
    451 on at
    Thanks Martin.
     
    If we get a json with too much data and we need just few of them is it ok to consume it as it is by just creating contract class with the data we require or should we transform the json using middleware to send obly the required fields if we use custom services.

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

News and Announcements

Season of Giving Solutions is Here!

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 679 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 429 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 264 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans