Read an array object and send its values to an API
Hi Appery team
I already know how to publish my data saved into a database and I've had read quite a lot in this forum to find out the way how to get a graph with those data. Well, with the code shown below I draw the chart that appears when I click on "Get chart" button. But, as you can see, that is possible because I wrote all the information that this API needs.
My question is. How can I avoid this in a third button?
I mean, I would like to read the information from my database records, and send them directly to the API to let it do its job. How can I do something like that?
Let you some screen shots from my app, so you can have a better idea what I'm trying.
Thanks in advance for your time.
Have a nice day.
1. Database name: dataList // Collection: dataDetails
2. My array variables are "mdName" and "mdAge"
My storage variable is "myData"
Service response for "Get list of friends" button
Code for "Get chart" button linked to a html frame
[quote:]
function barChart() {
//These are the parameters desired to be added dynamically from my database
var data = new google.visualization.arrayToDataTable([
['Friends', 'Age'],
['Robert', 24],
['Aeryn', 23],
['Ariana', 21],
['Chris', 25],
['Dean', 24]
]);var options = {
legend: {position: 'none'},
bars: 'horizontal',
};var chart = new google.charts.Bar(document.getElementById('plot_div'));
chart.draw(data, options);
}
[/quote]Test viiew
These are some of the issues that I read, related with Arrays. Because I believe it is a possible solution to my needs, but maybe "array variables" are not the best proposal.
01. Building a ToDo app
02 - Map JSON Array values
03 - Save array to local variable
04 - Response to an array
05 - Arrays in database