I'm creating a GQI to display a table in low code app with some specific elements data from my DMA, which is why I am trying to get them all and filter them by name.
To get all the elements I'm using the next lines:
var requestElementsMessage = new GetInfoMessage(DMA_ID, InfoType.ElementInfo);
ElementInfoEventMessage response = _dms.SendMessage(requestElementsMessage) as ElementInfoEventMessage;
When I send this message on the DMS unit test I can see that it is retrieving me a response for each existing element instead one response with all the elements data on it. So I'm not really sure if my variable response it's getting the last ElementInfoEventMessage in the queue or somehow is getting all of them.
How Can I manipulate all the "ElementInfoEventMessage' responses ?
Thank you Sebastian for taking the time to respond, I will review this documentation.
Hi Gina,
Next to the SendMessage method which returns a single DMSMessage you have another method that's called SendMessages (plural) which returns an array of responses (see docs). With this, you can send a single request and receive multiple responses.
However, I am wondering what is missing in GQI so that we can solve this use case without any additional coding. Are we missing a property on the data source or a filtering capability?
Edit:
Native way of using a drop down with elements to filter an element list:
Hey Sebastiaan, thank you so much for you answer it really helped me. My GQI is working now.
About the filtering, I could’ve used GetElementByNameMessage() to filter a specific element, but in my case I have a dropdown button that returns me a string and I use it to find the elements that contain this string in their name, that’s why I had to add a couple more lines. I’m not really sure if there is a better way to do it.
For completeness, I’ve updated my answer to include the native way of handling the use case you describe. Your approach is still valid though!
Hi Gina,
I suppose the default “Get Elements” query does not work for the filtering you are trying to do. But what about using an element property for filtering? You could set a certain property for the elements you want to show in your dashboard.
Or as another option, what about creating a custom operator that creates a column for further filtering? See details here: https://docs.dataminer.services/user-guide/Advanced_Modules/Dashboards_and_Low_Code_Apps/GQI/Extensions/GQI_Custom_Operator.html?q=customoperator
Mostly I would try to avoid SLNet calls, as those can change over versions and it would be safer if you can stick to the default query request.