Solved

Import data into user parameter type choice ?


Userlevel 1
Badge +22

Hi list.

I have a rather large list of choices with aliases, that I need to present to a workspace user when run. The dialog includes a button called "Import", and so I expected it to be able to read a database view with the choice values. But alas no, it reads nothing. Even though I tried to name the two view columns "Display Name" and "Value", the choice dialog remains empty.

There is no immidiate help for this, so I'm asking here instead.

What are the possibilities and caveats of using Import/From Dataset when populating a user parameter (type choice with alias) ?

I'm using 2020.2, but it's the exact same in 2022.0.

icon

Best answer by lifalin2016 2 June 2022, 13:19

View original

9 replies

Userlevel 1
Badge +22

billede

Userlevel 6
Badge +33

billede

For me this works as expected in 2021.2, using a CSV with columns Value and Display.

Value;Display
1;1
2;2
3;3

2022-05-24_10h45_012022-05-24_10h45_522022-05-24_10h46_42

Userlevel 1
Badge +22

For me this works as expected in 2021.2, using a CSV with columns Value and Display.

Value;Display
1;1
2;2
3;3

2022-05-24_10h45_012022-05-24_10h45_522022-05-24_10h46_42

From CSV, eh?

I tried to swap and rename my view columns to match your example, but still no luck.

My dialog (with Attribute Names/Attribute Values) is still blank.

Userlevel 1
Badge +22

For me this works as expected in 2021.2, using a CSV with columns Value and Display.

Value;Display
1;1
2;2
3;3

2022-05-24_10h45_012022-05-24_10h45_522022-05-24_10h46_42

Ps! This is the "Import Wizard" I see:

billede

Userlevel 6
Badge +33

For me this works as expected in 2021.2, using a CSV with columns Value and Display.

Value;Display
1;1
2;2
3;3

2022-05-24_10h45_012022-05-24_10h45_522022-05-24_10h46_42

Strange, CSV is missing from Feature Types. Did you also import from CSV or did you use another format?

Did you click "Parameters..." when selected CSV and the dataset to configure it?

 

I'm using 2020.2, but it's the exact same in 2022.0.

For me it just works in 2022.0 as well. (FME(R) 2022.0.0.0 (20220428 - Build 22337 - WIN64) )

Userlevel 1
Badge +22

For me this works as expected in 2021.2, using a CSV with columns Value and Display.

Value;Display
1;1
2;2
3;3

2022-05-24_10h45_012022-05-24_10h45_522022-05-24_10h46_42

Please see my initial text. I'm trying to read a database view (SQL Server), and yes, I did click "Parameters" to set the view to read from. All by the book.

Userlevel 6
Badge +33

For me this works as expected in 2021.2, using a CSV with columns Value and Display.

Value;Display
1;1
2;2
3;3

2022-05-24_10h45_012022-05-24_10h45_522022-05-24_10h46_42

I have no SQL server available at the moment so I can't reproduce your issue. I would export the database view to a file and use that to import to the choicelist.

Userlevel 1
Badge +21

For me this works as expected in 2021.2, using a CSV with columns Value and Display.

Value;Display
1;1
2;2
3;3

2022-05-24_10h45_012022-05-24_10h45_522022-05-24_10h46_42

How large is your list? Are there any special characters in the values you are attempting to import?

 

I'm able to import from an SQL Server table

Userlevel 1
Badge +22

billede

Both suggestions, CSV and SQL table, seems to work, but not SQL views. This is true for SQL Server, but I don't know if it's the case in other database types.

It looks like an oversight in the implementation, since views are important, and in my case essential for creating the needed list. I ended up doing a couple of intense copy'n'paste sessions to get my workspaces up and running, which is not optimal.

It would be nice if a Safer would enlighten us on this issue.

Cheers.

Reply