Form Recognizer is not returning "keyValuePairs" array in JSON output using pre-built model - azure-form-recognizer

I am having issue with form recognizer pre-build model JSON output. It is not giving me the keyValuePairs array results. I have watched alot of videos where they are getting this array in the JSON output but in my case it only returns "readResults" array rather that "keyValuePairs". I have taken a screenshot of keyValuePairs array from a video. Please have a look at:
And here is the output of my form recognizer API call results:
My URL sample is : https://myapp.com/formrecognizer/v2.1/prebuilt/invoice/analyze?includeTextDetails=true
Is there any kind of additional parameter needed to be passed in the URL to get this "keyValueParis" array ? Like for readResults I am passing the parameter includeTextDetails=true
Thanks

Your JSON output should have an additional section documrResults which includes the key value pairs. The readResult of the JSON output is all the text in the document.

Related

Array as value in json metadata properties send by Forge Derivative API

I have a question about the structure of metadata properties extract from a translated IFC model. In the JSON I get all the properties for all objects and sometimes the value for a property is an array.
For example in the picture, first line, the category of the object is not a string but an array.
I don't know if it's a bug or something wrong in the IFC but when I open it in IFC viewer, values are only strings, there is no array. The current IFC is the urban house model that I found on the Autodesk website and often used in the forge demo.
It's not a critical problem for me, I just check each time if the value is an array.
I just wanted to know.
Thanks
Example of array in properties values
You can download IFC and Revit file
Urban_House.ifc
Urban_House_2018.rvt

Triggering multiple webhooks with Zapier array of Json objects

I'm having trouble with triggering multiple webhooks via Zapier like explained on Zapiers website
Did anyone manage to use this functionality?
I'm trying to create "an array of properly formed JSON objects".
To be able to select it as data source in the next step it needs to be a simple array (thats why I stringify the jsons inside the array).
Here is the json array I'm creating in Zapier Code trying to use to trigger two separate webhooks being triggered
var jsonArray = ['{"id":1,"data":111}','{"id":2,"data":222}'];
output = {jsonArrayOut: jsonArray};
Here is a screenshot of a custom webhook request in Zapier
No matter how I format the data I always get one request, not two.
This is the result I see
Could anyone please tell me what am I missing?
Cool, so what you described in this comment should totally be possible.
Your zap will be the following:
Trigger - new email
Parse email, return an array of {id, data} (see below)
Update inventory (will happen for each item in the array in step 2)
This takes advantage of an undocumented feature of code steps where if they return arrays, the zap branches and subsequent steps run multiple times. Note that there's no UI for this and it'll look confusing, but it will work.
Your JS code will be something like the following:
// parse email code
// get items and their quantities
// return object that looks like this
return [{id: 1, data: 123}, {id: 2, data: 456}]
In step 3 (however you're doing that), you'll be able to select id and data as mappable inputs. When you're setting the zap up, you'll only see 1 and 123 as options, but when the zap is on and runs for real, step 3 will get run for each array element returned in step 2.
According to the docs:
You can send an array of properly formed JSON objects, and we will
trigger the Zap once for each object in the array.
Application will be able to parse through the json and understand its structure. Making it as a string makes it to lose it.
So I'm guessing sending it as a string might not work. The Application won't be able to find the number of elements inside the string, it will consider entire string to be one element.
Try,
output = [{"id": 1, "data": 111},{"id": 2, "data": 222}];

Angular 2+ mongoose, let on array doesn't work due to ID object

I am trying to do a let on an array of data that is requested from a mongoose server.
This works if I don't return the ID object with the rest of the Json data.
However I want to add the ID data as params to routernavigate to another component.
Is there an easy way of receiving the id as a string rather then an object?
You can use following to stringify your object data
JSON.parse(JSON.stringify(''));//use your result object as parameters
as a example JSON.parse(JSON.stringify(result['_id']));

How to get all countries from google map with AngularJS

how can i get JSON list of all countries (autocomplet) in select for example
With AngularJS (http://ngmap.github.io/)?
A "place autocomplete" request is a url http with the following format (output can have the values json or xml):
https://maps.googleapis.com/maps/api/place/autocomplete/output?parameters
The mandatory parameters are
input (string with the text you want to research)
key (the app's api key)
You can also set the location type you want (countries in this case). An example URL would be:
https://maps.googleapis.com/maps/api/place/autocomplete/json?input={TYPED_TEXT}&types=countries&key={YOUR_API_KEY}
You can check a detailed Google documentation for this here: https://developers.google.com/places/web-service/autocomplete

How to get tabs in angular forms based on given xml file?

I have to get number of input tabs or fields based on given xml or json file.
example : If xml has 3 tags, then form should contain 3 input fields.
Same with JSON.
You can use ng-repeat on service response array of objects. And also you can create new scope variable & assign unique property of response array object to it. Then you can have as many number of input fields based on service data & also dynamic ng-model on them to handle their model data to submit it.
This is small example which demonstrates your requirement: http://jsfiddle.net/DrQ77/
For xml response, better use xml to json library plugins to convert it to json data https://github.com/abdmob/x2js. Or prefer server side sending json data (with implementing xml to json functionality at server side).

Resources