jamuri
(jamuri)
February 27, 2019, 4:01pm
1
I having an issue to read and get value from json file.
I need to get the value for all info under IndexFields
sample json file as below.
{“Invoice”: {
“IndexFields”: {
“amount”: “1,19 7.00”,
“description”: “abc" 1 PLY”,
“invoice_date”: “18/01/2019”,
“invoice_no”: “052108”,
“invoice_to”: “123 pTD”,
“po_number”: “104321”,
“quantity”: “35”,
“unit_price”: “34.20”
},
“PDFLocation”: “C:/Ephesoft/SharedFolders/final-drop-folder/CustomExport/BI9_Invoice_DOC1.pdf”,
“TableData”: “”
}}
Attached sample xml file which i got error message “System.NullReferenceException: Object reference not set to an instance of an object.”
J0ska
February 27, 2019, 4:35pm
3
Hi,
1/ The double quotes in your example are not valid. It should be " = char(34)
2/ To get e.g. “amount” use the following statement YourJsonObject(“Invoice”)(“IndexFields”)(“amount”)
Cheers
jamuri
(jamuri)
February 28, 2019, 1:20am
4
Hi J0ska,
I’m not clear, can you give me sample xml file.
Thank you
Regards
jamuri
(jamuri)
February 28, 2019, 1:58am
5
Hi J0ska,
Manage to get the value based on your command above.
I have another question how can I loop if the info repeating but having another value.
Thank you
Regards
Jamuri
J0ska
February 28, 2019, 9:26am
6
Hi,
A simple example, for reference for others.
json.zip (1.9 KB)
Cheers
J0ska
March 1, 2019, 10:12am
7
Hi,
Could you supply sample of such Json with repeating info. Preferably as attachment.
Cheers