Build Array from service data
Hi,
Could you give me some pointers with the following.
I have a service that returns details of current jobs for the logged on user, I want to call the service with variables added from local storage, two variables are required I am not quite sure how you would construct the two variables to pass as a single variable to the service:
var delimiterA = localStorage.getItem(account);
var delimiterB = localStorage.getItem(user);
var job = new Array();
job = jobsservice.execute({delimeter});
at this point I want to extract an element (jobnumber) from each job that is returned checkout local storage to see if the job already exists and if not add the job as an stringified array.
I have not quite got this can you show me the correct methods required to achieve the building of the delimiter and how to save the returned jobs as a query able array at the moment my var job is returned as an object. The data returned from the service using the test button is below.
[
{
"id":"50bcba40e4b0747d4efe4db5",
"createdAt":"2012-12-03 06:42:08.533",
"updatedAt":"2012-12-13 08:38:59.871",
"account":"systems",
"address":"Ford Genk,
Mondeo Street,
Genk,
Belgium",
"contact":"j.bohen",
"driver":"joe",
"duedate":"2012-12-07 20:00:00.000",
"goodsdescription":"12 euro pallets",
"jobnum":"100123:del1",
"latlon":"45.344512,
-1.27667",
"status":"On Route"
},
{
"id":"50bcb898e4b0747d4efe4db4",
"createdAt":"2012-12-03 06:35:04.545",
"updatedAt":"2012-12-13 08:39:22.567",
"account":"systems",
"address":"Ford Motors,
Hall Lane Ind Est,
Melton Mowbray,
Leicestershire",
"contact":"j.bohen",
"driver":"joe",
"duedate":"2012-12-05 06:00:00.000",
"goodsdescription":"12 euro pallets",
"jobnum":"100123:col2",
"latlon":"45.344512,
-1.27667",
"status":"On Site"
}
]