Hi,
Usecase : I want to get all elements in specific view but only of specific protocol type.
View contains other subviews and tree is complex.
Running individual methods getElementsforProtocol or getElementsforView would return lot of elements while second filter would provide much smaller response.
You could use the GetElementsForViewSorted request from the v1/[Json|Soap] api to achieve this.
Its soap body looks like this:
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <GetElementsForViewSorted xmlns="http://www.skyline.be/api/v1"> <connection>string</connection> <viewID>int</viewID> <includeSubViews>boolean</includeSubViews> <includeServices>boolean</includeServices> <startsWith>string</startsWith> <query>string</query> <index>int</index> <count>int</count> <orderBy>string</orderBy> </GetElementsForViewSorted> </soap12:Body> </soap12:Envelope>
For your use case it would look something like this:
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <GetElementsForViewSorted xmlns="http://www.skyline.be/api/v1"> <connection>my-connection-id</connection> <viewID>my-view-id</viewID> <includeSubViews>true</includeSubViews> <includeServices>false</includeServices> <startsWith></startsWith> <query>my-protocol-name</query> <index>0</span></index> <count>10_000</count> <orderBy>Name</orderBy> </GetElementsForViewSorted> </soap12:Body> </soap12:Envelope>
Hi
I tested as you advised. Indeed this is what I needed.
Based on the method name it was not clear to me that this will be feasible.
Checked now the docum says:
query – If, in this field, you enter a piece of text, then the method will only return view child items of which the protocol name or element name contains that piece of text.
so only element name and protocol are compared…
thanks
Rgds,
Martin
Depending on the use case, if you want to display this in a Dashboard for instance, you could also use GQI which allows extensive querying and filtering.