Skip to main content
Solved

Import data into user parameter type choice ?


lifalin2016
Contributor
Forum|alt.badge.img+29

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.

Best answer by lifalin2016

lifalin2016 wrote:

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.

View original
Did this help you find an answer to your question?

9 replies

lifalin2016
Contributor
Forum|alt.badge.img+29
  • Author
  • Contributor
  • May 24, 2022

billede


nielsgerrits
VIP
lifalin2016 wrote:

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


lifalin2016
Contributor
Forum|alt.badge.img+29
  • Author
  • Contributor
  • May 24, 2022
nielsgerrits wrote:

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.


lifalin2016
Contributor
Forum|alt.badge.img+29
  • Author
  • Contributor
  • May 24, 2022
nielsgerrits wrote:

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


nielsgerrits
VIP
nielsgerrits wrote:

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) )


lifalin2016
Contributor
Forum|alt.badge.img+29
  • Author
  • Contributor
  • May 24, 2022
nielsgerrits wrote:

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.


nielsgerrits
VIP
nielsgerrits wrote:

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.


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • May 24, 2022
nielsgerrits wrote:

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


lifalin2016
Contributor
Forum|alt.badge.img+29
  • Author
  • Contributor
  • Best Answer
  • June 2, 2022
lifalin2016 wrote:

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings