Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jim_chan
Specialist
Specialist

GetSelectionField with displaying multiple value with new name

Hi all, 

I need to create a table, with a dynamic title . i thought of using getFieldSelection, but may have something wrong in my script and i couldnt get the expected result.

ok. scenario, when user select chicken breast in a list box, then title of the table will change to CHICKEN(instead of the actual field value. 

Next scenario, if the user also select chicken breast and cauliflower, title will change to CHICKEN,VEGE(instead of chicken breast, cauliflower)

I have attached a sample qvw file , please guide me to by editing the script.

Rgds

Jim

 

Labels (1)
1 Solution

Accepted Solutions
DavidM
Partner - Creator II
Partner - Creator II

Hi, your formula doesn't work because the IF condition is not fulfilled when you select two values. If you select chicken breast and spinach, you get 'chicken breast, spinach' - you would have to create condition for this, but that still wouldn't work the way you intend. You don't need IF at all in this case, when you just want to replace two values, you need to do it like this:

=Replace(Replace(GetFieldSelections(product), 'chicken breast', 'CHICKEN'),'spinach', 'VEGE')& ' ' & 'AMOUNT GA (' & Chr(39)&'000)'

 

Also you had typo in spinach

 

View solution in original post

2 Replies
DavidM
Partner - Creator II
Partner - Creator II

Hi, your formula doesn't work because the IF condition is not fulfilled when you select two values. If you select chicken breast and spinach, you get 'chicken breast, spinach' - you would have to create condition for this, but that still wouldn't work the way you intend. You don't need IF at all in this case, when you just want to replace two values, you need to do it like this:

=Replace(Replace(GetFieldSelections(product), 'chicken breast', 'CHICKEN'),'spinach', 'VEGE')& ' ' & 'AMOUNT GA (' & Chr(39)&'000)'

 

Also you had typo in spinach

 

jim_chan
Specialist
Specialist
Author

Dear David, 

Many thanks on your help, it saved me ! solved my problem. and thank you, learnt something.

rgds

Jim