-
Notifications
You must be signed in to change notification settings - Fork 0
How to obtain distinct values from a SmartObject
Konstantin edited this page Dec 4, 2017
·
3 revisions
Let's imagine, you need to populate a Listing control (DropDown or anything else) with distinct values from a certain SMO. You can easily achieve this with the help of the current ServiceBroker. For the demo purposes I will be using a SmartObject with the following values, where Name property will be used as a DisplayName and Value - as a value for a Listing control:
- Configure a new ServiceObject for your ServiceInstance by adding the following json. For the current tutorial we can assume, that a Value will be of Number type and the DisplayName will be Text.
[
{
"SoName":"ListingControlValues",
"Properties":[
{
"Name":"Value",
"Type":"Number"
},
{
"Name":"DisplayName",
"Type":"Text"
}
]
}
]
After doing this, you will see the following structure of your Service Instance:
- Create a SmartObject from the generated ServiceInstance
- Add a DropDown control onto your view and map it to the newly created SmartObject:
- Add the following query into AdoQuery field, which is used as an input parameter to populate the Listing control:
SELECT DISTINCT [Value] AS [Value], [Name] AS [DisplayName] FROM Test_Smo_ValuesForDropDown
5. Open your view and check the values in the dropdown control: