Distinct LOV values for Universe object through SDK

Hello Users,

I have a universe object which is introduced through the Universe SDK.

Let’s say it’s a country column and the table has multiple values of the same, even in the LOV.

USA
USA
USA
UK
UK

etc.

In the universe, what we normally do is to go to Object -> Properties -> Edit ( under the LOV section)

Here i write a custom SQL

SELECT DISTINCT
table.column FROM
table
ORDER BY
1

This helps the users to not to see duplicate LOV values.

I am stumped as to how to achieve the same through SDK. Doing this manually beats the whole purpose of our automation through SDK.

Any advice would be much appreciated.


ramaks (BOB member since 2009-03-31)

When building an object manually (interacting with the software) you don’t have to create the LOV. All you have to do is enable it with the checkbox. The LOV gets created “on demand” when a user requests it. Are you sure you even need to go through this step?


Dave Rathbun :us: (BOB member since 2002-06-06)

There might be some value in the Order By clause. Some databases / versions don’t do that automatically with a Distinct clause. Other than that, Dave is correct. That’s pretty much a default LOV … Select Distinct on the SQL from the object itself … done without any customization.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

Dave,

You are correct. The only problem is that the default distinct is created only for objects of character type as per my obervation.

The objects in my Universe are all Long Text, and once this type is choosen the distinct is lost.


ramaks (BOB member since 2009-03-31)