I am a beginner in angular. My question is - Based on the excel file which user uploads, api returns some data in JSON format. So the column headers and data are dynamic. I want to display the json data in HTML table.
I want to know how should my json look like and its respective TS and HTML code.
User upload an excel file like this
file example
My output should look like this :
output
First column and row is dynamic.
As you are new to Angular, I will show you one of the procedure you can use
Angular part:
Every time the server sends data, you can get your data by HTTP methods or web-socket by "service" from angular.
Service:
in services, you can import HTTP to get data and after you get data you can emit it by using "behavior-subject" to any component you want which contains your tables and save data values there. (behavior-subject is from rxjs library).
Component:
Now your component in angular has the json data every time and you can analyze
your JSON file, based on your JSON shape you can use *ngfor in the HTML part of the component table and it will change the table online.
Related
I am new to reading Json data and populating the form. I have spent few days on this and still cannot figure out.
HTML data
Jason data object response
I am trying to populate the form field jobDescId, EducationId from JSON response.
To start with, I am trying to use Jquery to find the form field that I am looking
$(".BasicInfo.Education0.EducationId") and this is not working..I get the following when I run this Chrome dev tool tab.
w.fn.init [prevObject: w.fn.init(1)]length: 0prevObject: w.fn.init [document][[Prototype]]: Object(0)
I am not sure how to loop the data as I have two item for education list.
In data factory I'm using a Copy Data activity where the Source is a REST API, that's returning data in JSON format, with a Sink thats a JSON file type in ADLS Storage.
The problem I'm having is that only the first record in the "Domestic Title Nos" array appears in the JSON file. The remaining records, however many, are not to be seen.
Also, when I "Preview" my data in the Source page, it shows all the nested data in the array.
API Call Returns this JSON data
Mapping in my Copy Data activity
File contents after sink to JSON file type
As shown in below screenshot, you have used items as Collection reference.
You need to use “Domestic Title Nos” as Collection reference.
Note: For records where the array marked as collection reference is
empty and the check box is selected, the entire record is skipped.
Refer - Schema and data type mapping in copy activity
In the end it worked out to be easier to download the entire JSON document using
this mapping and then used "Flatten" in a Data Flow to extract the parts that I needed.
I would like to know if I could filter a report before download it's data inside the csv file, I'm using this url:
https://secure.gooddata.com/gdc/app/projects/project_id/execute/raw/
I couldn't found any information at gooddata api about this, the body of the post request accept this json:
{'report_req': {'reportDefinition': '/gdc/md/{project_id}/obj/{obj_id}'} }
There are other parameters for filtering the data?
If don't, there is another way to download filtered data?
If there is another way, can I change from .csv to .json? Or maybe get the json data inside the response body?
Definition of filters is a part of "reportDefinition". The solution is to use or create report definition which contains required filters and perform the mentioned "execute/raw" call. Result of "execute/raw" call is always in csv format.
For Example,
I have a document in my CouchDB database that holds two fields
"password" and "username".
This is the URL for my document:http://127.0.0.1:5984/_utils/document.html?sgram/fdcfc14940fbaa0d86674046ce005107
I want to retrieve the value of these fields from that specific document in CouchDB and parse it in Xcode.
I tried using http-get but it just returns the entire page source.
You want to make a request to this endpoint
http://127.0.0.1:5984/sgram/fdcfc14940fbaa0d86674046ce005107
For a json response from couchdb just don't include _utils/document.html in between. If you do it will give you back the futon html page.
I am trying to render my data in a graph using fusion charts. I have a web service that returns the data in JSON format. I want to render chart for that data. can I directly give the URL of my web service so that I cannot set key value pairs. Is it possible to do so/ Can any one please tell me how to do this.
It can use a JSON URL/feed, a JSON Object (in JavaScript) or JSON String. This functionality is provided by FusionCharts class method setJSONUrl(). Example
myChart.setJSONUrl("Data.json");
See http://docs.fusioncharts.com/charts/contents/FirstChart/JSONData.html
FusionCharts Suite has a specific JSON structure for each category of charts. While passing the data to render method, data is expected in the pre defined format. Please refer to: http://docs.fusioncharts.com/charts/contents/DataFormats/JSON/Overview.html