User bio
404 bio not found
Member since Mar 7, 2016
Posts:
Replies:
Thanks, the .%Get("pdf",,"stream<base64") works.
It is super frustrating though.
This produces an error: <PARAMETER> 127 %GetNext^%Iterator.Array.1
Set iter = jsonob.value.labReports.%GetIterator()
While iter.%GetNext(.key,.labReport,.type) {
w !,"type: "_type
}
I do not know if it a bug on my side or the documentation:
My code:
try{
Set jsonob = ##class(%DynamicObject).%FromJSON(httprequest.HttpResponse.Data)
w !,"statusCodes: "_jsonob.%Get("statusCode"),!
Set iter = jsonob.value.labReports.%GetIterator()
While iter.%GetNext(.key, .labReport) {
w !,"reportName: "_labReport.%Get("reportName")
Set pdf=labReport.%Get("pdf",,"stream<base64")
w !,"pdf: "_pdf.Read(20),!
}
} catch(tException) {
w !,tException.DisplayString(),!
}
JSON looks like this( pdf the offending big string):
Output:
statusCodes: 200
reportName: Long-Oeloff-Badenhorst.pdf
<MAXSTRING> 5 ztestpdf+36^Test.Testy.1
ztestpdf+36 = Set pdf=labReport.%Get("pdf",,"stream<base64")
Open Exchange applications:
Certifications & Credly badges:
Nicki has no Certifications & Credly badges yet.
Global Masters badges:
Nicki has no Global Masters badges yet.
Followers:
Following:
Nicki has not followed anybody yet.
Redacted