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

Data Exchange Definition for Json

(4) ShareShare
ReportReport
Posted on by 891
Can anybody point me in the direction of a tutorial about configuring a Business Central Data Exchange Definition for importing Json data? I've created ones in the past to handle CSV data, but not Json.
This requirement is to work in conjunction with a Currency Exchange Rate Services set-up.
 
Here's the format I need to handle:-
 
{
    /disclaimer/: /Usage subject to terms: https://openexchangerates.org/terms/,
    /license/: https://openexchangerates.org/license/,
    /timestamp/: 1692266400,
    /base/: /USD/,
    /rates/:
    {
        /AED/: 3.67305,
        /AFN/: 84.67614,
        /ALL/: 96.873903,
        /CAD/: 1.352029,
        /CHF/: 0.879243,
        /EUR/: 0.919645,
        /GBP/: 0.786105,
        /USD/: 1
    }
}
 
Thanks in advance for any help.
I have the same question (0)
  • Nick Webb Profile Picture
    891 on at
    Apologies. The web-site mangled the Json. Here's another try:
     
    {
    	"disclaimer": "Usage subject to terms: https://openexchangerates.org/terms",
    	"license": "https://openexchangerates.org/license",
    	"timestamp": 1692266400,
    	"base": "USD",
    	"rates":
    	{
    		"AED": 3.67305,
    		"AFN": 84.67614,
    		"ALL": 96.873903,
    		"CAD": 1.352029,
    		"CHF": 0.879243,
    		"GBP": 0.786105,
    		"USD": 1
    	}
    }
     
     
     
  • Suggested answer
    Ram Pranav Profile Picture
    50 on at
  • Nick Webb Profile Picture
    891 on at
    Hi Ram,
     
    Thanks for your response. Yes, I've seen all 3 of those links before:
     
    'Set Up Data Exchange Definitions' is too generic. It only mentions Json once in the whole page. I'm after a web-page that is specific to handling Json. For instance, what should the various Codeunits be set to in the Data Exchange Definition page?
     
    Also, how do you map the various nodes/tags in the incoming Json to the Line Definitions, Column Definitions & Field Mapping? Note, in my sample Json, the rates tag is an array of key/value pairs (Currency-Code & Rate). How is that configured?
    There's also Field Mapping in the Currency Exch. Rate Service page. Where should the settings be assigned? In the Currency Exch. Rate Service page, the Data Exchange Definition page, both, other?
     
    I'm looking for a tutorial page that first shows a sample bit of Json data and then describes how to configure the various BC pages to handle it?
     
    'Update Currency Exchange Rates' will come into play once I've handled the Json.
     
    'Getting exchange rates from a JSON web service in Business Central' is very useful, but it completely bypasses the above 2 methods. It's a custom extension solution. My question is: can it be achieved in the BC GUI without an extension?
     
    Regards
    Nick
  • AL-04070808-0 Profile Picture
    2 on at
    @Nick Webb - did you ever manage to solve this? If so - how? 😊
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,601 Super User 2025 Season 2 on at
  • Nick Webb Profile Picture
    891 on at
    Not with Data Exchange Definition. I had to write a codeunit.
  • Suggested answer
    Jeffrey Bulanadi Profile Picture
    8,760 on at
    Hi Nick

    Handling JSON with Data Exchange Definitions in Business Central isn’t as straightforward as CSV, but it’s doable with the right setup. Since you’re working with a Currency Exchange Rate Service, the key is mapping the JSON structure to the expected fields in Business Central

    Here’s what you can look into

    If you’re looking to avoid custom extensions, the standard Data Exchange Definition might not be enough to handle nested JSON like this. You’d need to build a small extension that reads the JSON and maps it to the Currency Exchange Rate table

    If this helped, feel free to mark it as the suggested or verified answer

    Cheers
    Jeffrey
  • Suggested answer
    YUN ZHU Profile Picture
    95,729 Super User 2025 Season 2 on at
    Hi, hope the following can give you some hints.
    Business Central 2025 wave 1 (BC26): Overloaded JsonObject data type GetValue method (New methods access properties and array elements for JSON)
     
    Thanks.
    ZHU

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,238

#2
YUN ZHU Profile Picture

YUN ZHU 773 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 630

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans