Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Contributor
Posts: 57
Registered: ‎11-23-2015
Accepted Solution

None/empty values in a LOV

For filtering a feature with different attributes we use a LOV of a FormField, f.e  {Form.Feature}.

If we define the LOV we always get an "(None)" (in german a "(Leer)") in the dropdown. 

Is there a possibilty to hide the "(None)" in the LOV-Dropdown? Or to make a SQL query on the "empty value" ?

 

 

The following queries don’t work:

 

SQL SELECT …  FROM …  WHERE  ({FORM.Feature}='(None)' AND …)]

SQL[SELECT … FROM …  WHERE  ({Form.Feature}='' AND …) ]

SQL[SELECT … FROM …  WHERE  ({FORM.Feature} AND …)]

SQL[SELECT … FROM …  WHERE  ({FORM.Feature} IS NOT NULL  AND …)

 

The reason why we want to get rid of the "None" is, that if the users selects "none" the query can't work and runs without results and it is also a little confusing to have two fields for "None/empty" and "no value" (this is a field we need to select features which really don't have a value in the selected attribute).

GBI Kommunale Infrastruktur GmbH & Co. KG | Germany
Highlighted
Staff
Posts: 1,055
Registered: ‎10-18-2015

Re: None/empty values in a LOV

Hi,

 

I think you have to manipulate the widget via Javascript or create your own custom one.

Actually what you can do is to validate user selection via script before running the query. 

 

ciao,

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Highlighted
Contributor
Posts: 57
Registered: ‎11-23-2015

Re: None/empty values in a LOV

Thank you very much for your answer.

 

We already tried to manipulate the combobox via JavaScript in order to remove/hide the empty value, but unfortunately without success.

If there is no possibility to make a SQL query on the "empty value" we will probably try the following solution:

We will generate an additional FormField for each combobox (where we have to check on SQL if the value is emty).

In the additional FormField we could  check if the combobox has the empty value via Javascript (IG.hasNoValue()) and then check on our SQL query if the additional FormField is TRUE or FALSE.

 

Just wanted to get sure, that there isn't an easy way to solve this.

GBI Kommunale Infrastruktur GmbH & Co. KG | Germany
Highlighted
Staff
Posts: 1,055
Registered: ‎10-18-2015

Re: None/empty values in a LOV

there was another post in the old user forum to hanlde null values in queries. The sample was

 

SELECT * 

FROM BUILDINGEXTENSION
WHERE 
   Comments = coalesce(Nullif({ENTITY.FirstInput} , ''),Comments) AND
    Editor = coalesce(Nullif({ENTITY.SecondInput} , ''),Editor)

It was for predefined queries, so the placeholder is related to that. Maybe you can adapt it using form placeholder.

 

HTH,

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial