Question

Set dropdown parameters from attribute values

  • 11 July 2017
  • 3 replies
  • 25 views

I would like to set a user parameter so that when I run the workspace, I will get a prompt giving me a dropdown list to choose different attribute values. For example, I have a shapfile for municipal boundaries, and there is one attribute called MUNI_Name. Under this MUNI_Name, there are different minicipalities. I would like the dropdown list to show those different municipal values so that I can choose one. Is this possile?


3 replies

Userlevel 1
Badge +21

Do you know the different municipalities now or are you wanting something dynamic?

Badge

I don't think there is a way to do this dynamically.

There are three options:

1- Use the parameter Import wizard to get all the values:

0684Q00000ArKLyQAN.png

2- What we are doing here is create a workspace that will generate a string to cut and paste in the parameter configuration text box. In other words, read the shapefile, get all distinct municipality names and concatenate them to fit the parameter configuration.

As an example for a choice with alias parameter:

Name<space>of<space>mun1,id1%Name<space>of<space>mun2,id2%Name<space>of<space>mun3,id3

3- Another option that we use (this is kind of a hack) is an application that edit directly the fmw file with the desired parameter configuration (most of the time the result of a select query in a database).

Userlevel 4
Badge +25

As @egomm says, it depends on whether your values are fixed or dynamic. If they are fixed then you can create a choice parameter and use the Import tool to import the list of municipalities.

Movie demo here: https://www.screencast.com/t/3ITw04XuHUy

Dynamically it is more complicated. In fact I can't think of a good way - unless you are using FME Server and can construct a HTML page. But let's see if the above choice works for you first.

Reply