Qlik Sense API: Viewing data from a .qvf file in my Angular application - qlikview

Alright, I'm new to working with the Qlik API and wanted to know if you can help me extract the data from a table from a .qvf file and filter it as if I were launching SQL queries or something similar.
For now I show the data that a table contains using this structure:
{
"handle": 1,
"method": "GetTableData",
"params": {
"qOffset": 0,
"qRows": 1500,
"qSyntheticMode": true,
"qTableName": "Hoja1$"
},
"outKey": -1,
}
}
How can I filter the data I retrieve?
It is that I want to show the data in some KPIs developed in a FronEnd in angular.
Thank you very much greetings!

Related

I am facing issue for selenium webdriver script for Goibibo site city selection using xpath/css selector

While selecting city from site using xpath/css selector facing issue let me know solution
List<WebElement> frm=driver.findElements(By.cssSelector("html body div#gi_midcontent.col-md-12.col-sm-12.col-xs-12.pad0 div#gi_mid_in div#viewContainer div#flights-home-view.homeContainer.col-md-12.col-sm-12.col-xs-12.myPropDisplay div.homeContainerInner div#searchWidgetNew.blueBg.homeWidgetWrap.posRel form#gi_search div#searchWidgetCommon div.formWrap.padT15 div#source_st.fl_shAutosgBox.col-md-5.col-sm-5.col-xs-12.autoSuggestBox.marginB10 input#gi_source_st.form-control.inputTxtLarge.fromTxt.posRel"));
Couple of things.
Go through the selenium document here.http://www.seleniumhq.org/docs/03_webdriver.jsp
Read on how to use different locator strategy to identity particular locator.
Don't ask the question just because something is not working,spend some time on that.
Visit this page to understand how to ask question so that you can get answers.
The reason I have mentioned above point is you css locator looks pathetic, also the locator you are trying to identify has both name and id, and if you now how to use locator you could have figure that out.
The selector specified in the problem mixed id and class. However, taking a look at the website, the suggested city list is not offered as a group of input elements but fetched from AJAX.
Sending GET query with Postman tool on this URL and you can get JSON data with a list of objects. The property of json["data"]["r"][index]["xtr"]["cn"] seems a string of "CityName". This API does not require authentication so it can be fetched with Java HttpClient, too.
https://voyager.goibibo.com/api/v1/flights_search/find_node_by_name_v2/?search_query=hint&limit=10
The sample result:
{
"data": {
"r": [
{
"s_sc": 5055001,
"xtr": {
"cn": "Beica",
"cid": "1918715907401915921",
"cc": "ET",
"dis_type": "ldis",
"ar": 0,
"eid": "7717797727439208389",
"cnt_n": "Ethiopia",
"cnt_id": "1871100673297067773",
"dis": 0
},
"iata": "BEI",
"n": "Beica Airport",
"mt": "Beica Airport ### Beica",
"t": "airport",
"_id": "7717797727439208389",
"ct": {
"_id": "1918715907401915921",
"n": "Beica"
}
},
...
]
}
}
Please replace "hint" with your query string, for example, a letter to start with. Also take the note that (page) limit could not be greater than 50 in one query.

Not getting results field after querying task by ID in Lookback API

I'm trying to query tasks by ObjectID to get their most recent snapshots. I'm trying the API out, and am not getting the expected results that I was hoping for after reading the docs. I don't get a results field in the response object. Here's my code:
_loadTaskSnapshot: function() {
let snapshot = Ext.create('Rally.data.lookback.SnapshotStore', {
context: {
workspace: '/workspace/2290039850'
},
"find": {
"ObjectID": 34858774310,
"_ValidFrom": {
"$gte": "2016",
"$lt": "2017"
}
},
"fields": ["Name", "Estimate", "ToDo", "TimeSpent"],
});
return snapshot.load();
}
This is the store with 18 snapshots for the specified task. The first snapshot is opened. You can see there is no results field where I could find the Name, Estimate, ToDo, and TimeSpent:
Alejandro, you are asking for the changes in the fields, not the values of the fields. This is a common misconception with the lookback api. There is a special way to get the current values shown in the help pages available inside Agile Central.
Any information returned is actually held within the object underneath 'raw' and 'data'. Each of those may not contain any values if there has been no 'changes' to those fields at the time the snapshot was taken.

WooCommerce REST API Custom Fields

Is it possible to access custom fields for orders, products, customers via WooCommerce REST API? If not natively, then what plugins or workarounds or hacks are out there that work? Thanks!
Answering my own question:
It is possible using the following: (using v3 legacy API)
To send custom fields back to the server:
(For Orders)
{
"order_meta": {
"key": "value"
}
}
To retrieve custom fields from server use this filter with your end point:
http://www.example.com/wc-api/v3/orders?filter[meta]=true
This works for Products as well.
As mentioned in the comment after WooCommerce creates an order via the API it will fire woocommerce_api_create_order hook, you can make use of it.
Add the following code to your theme's functions.php file
add_action( 'woocommerce_api_create_order', 'my_woocommerce_api_create_order', 10, 2);
function my_woocommerce_api_create_order( $order_id, $data ) {
// $data contains the data was posted, add code to extract the required
// fields and process it as required
}
Similarly look at the code in plugins/woocommerce/includes/api/*.php files, find the suitable action or filter hook for the end point and use it.
SIMPLE SOLUTION THAT WORKED FOR ME (using REST API REQUEST):
URL: https:///wp-json/wc/v3/orders/1234
METHOD: PUT
BODY:
{
"status": "completed",
"meta_data": [{
"key": "is_web_server_handled",
"value": "1"
}]
}

Get User Stories for each Release Feature Lookback API

I need to add some customization to BurnDownApp.
and I want to retrieve all User Stories for Release from 'Release Combobox' + All Users stories which linked to Portfolio Item features which linked to release.
In default implementation I can retrieve only User Stories which linked to Release:
find: {
"_TypeHierarchy": { '$in' : [ -51038] },
"Children": null
}
I tried to use this query:
find:{
$and:
[{"_TypeHierarchy": -51038, "Children": null},
{"_TypeHierarchy": { '$in' : [ -51038, -51006 ] },
"Children": null
"Feature.Release.Name": "%ReleaseName%"}]
}
but it doesn't work
How I should change query for get needed data?
Link to BurnDownApp on github: https://github.com/RallyApps/app-catalog/tree/master/src/apps/charts/burndown
Even though a WS API query (Feature.Release.Name = "r3") will work:
https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement?workspace=https://rally1.rallydev.com/slm/webservice/v2.0/workspace/12345&query=(Feature.Release.Name = "r3")
This will not work in Lookback API.
This Lookback API query "Feature":7777 will work. In this example 7777 is ObjectID of a feature:
https://rally1.rallydev.com/analytics/v2.0/service/rally/workspace/12345/artifact/snapshot/query.js?find={"_ProjectHierarchy":22222,"_TypeHierarchy":"HierarchicalRequirement","ScheduleState":"Accepted","Feature":7777,"_PreviousValues.ScheduleState":{ "$lt":"Accepted"}},sort:[{"ObjectID": 1},{_ValidFrom: 1}]&fields=["Name","ScheduleState","PlanEstimate","Release"]&hydrate=["ScheduleState"]
If you want to get features in the custom app dynamically based on a release combobox selection you may:
Use wsapi data store to find those features (get their OIDs), and then
Use snapshot to get historical data on stories that associated with features. Filtering them based on "Feature": {$in:[7777,8888,9999]} in the find should work.

How to use localstorage in Titanium/Alloy?

I am very new to Appcelerator/Titanium. Can anyone tell me how to use localstorage function in Alloy (Titanium). (Not getting any good solution on Web).
Thanks! :)
Titanium Alloy has a customized implemntación Backbone. This means that titanium uses Backbone for many things, but at the same time some important features have been left out.
One of the most used parts of Backbone by Titanium are models, while that not identical to those ofrese the js framework, they have lots of things in common.
To work with data models must define an adapter (this can be localStorage, sql, properties or custom sync adapters)
If you want to work with localStorage, your model should look something like this:
exports.definition = {
config: {
"defaults": {
"first_name": "",
"last_name": "",
"phone": "",
"email": ""
},
"adapter": {
"type": 'localStorage',
"collection_name": 'user'
}
},
extendModel: function(Model) {
_.extend(Model.prototype, {
}); // end extend
return Model;
},
extendCollection: function(Collection) {
_.extend(Collection.prototype, {
}); // end extend
return Collection;
}
};
to manipulate the data then you should use:
Create data
model = Alloy.createModel('user', {first_name: 'Pedro', last_name: Picapiedra});
// or model.save();
Alloy.Collections.user.add(model);
Read data
callection = Alloy.Collections.user.fetch()
model = Alloy.Collections.user.get(modelId)
Update data
user.set({
first_name : 'Pablo',
last_name : 'Marmol',
});
user.save();
Delete data
model.destroy();
collection.remove(model);
For more information:
Titanium Sync & apadters
Backbone Sync, collections, models & etc
See https://wiki.appcelerator.org/display/guides/Working+with+Local+Data+Sources for general guide.
Accessing files is done through the Ti.Filesystem. See documentation at http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Filesystem . You should also see the kitchen sink example, as it shows hot to read/write file https://github.com/appcelerator/KitchenSink/blob/master/Resources/ui/common/platform/filesystem.js.
If you simply want to store some data locally, many people use sqlite database. See http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Database .
The simplest way is to use properties. It is limited, but for many people that is enough. http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.App.Properties