Simon
4Penny.net
Points: 7583

3/24/2022 8:22:00 AM

Retrieve JSON from disc and convert to a searchable Dictionary object

I'm a SQL guy, normally I would not be found more than 5 feet from a SQL Server. 

But Business Central (BC) and D365 is coming to power, and that has me coding ... without SQL. 

Today's task is part of an integration, I've downloaded a file that needs to get integrated into BC, but several of the fields need to be translated

This code will take this JSON:

{
  "status": "SUCCESS",
  "shop": [
    {
      "shopname": "Store #1 - 3330",
      "shopcode": "3330",
      "taxareacode": "WILSON, NC",
      "invoiceprefix": "WIL-"
    },
    {
      "shopname": "Store #2 - 3310",
      "shopcode": "3310",
      "taxareacode": "GOLDSBORO, NC",
      "invoiceprefix": "GOL-"
    }
  ]
}

and import it into a dictionary object so that it can be searched during the import. 

Restated: The raw data will have "Store #1 - 3330', we need to use the 'shopcode' during the integration so we'll look it up. 

 

 

4Penny.net
Version: Unknown or N/A
Section: eConnect,.NET Development,SmartConnect,Dynamics 365
Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables
3