Multiple Value parameter not working

Michael Katz
Michael Katz used Ask the Experts™
on
Getting error 'A String is required here'

The Parameter (?StandardComments) is setup as a string.. with multiple values

1.Line1 has been chosen
2.Line2 has been chosen
3.Line3 has been chosen
4.Line4 has been chosen

I have created a Formulas based on the parameter

if {?StandardComments}
startswith '1.' then cstr(mid({?StandardComments},3,100))
else if {?StandardComments}
startswith '2.' then cstr(mid({?StandardComments},3,100))
else if {?StandardComments}
startswith '3.' then cstr(mid({?StandardComments},3,100))
else if {?StandardComments}
startswith '4.' then cstr(mid({?StandardComments},3,100))

Why won't this work.. It will work without multiple values
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
What is the formula supposed to do?

When you have a multiple-value parameter, it is implemented as an array thus it is not a string but rather an array of strings.

You need to work on the individual elements of the array using an index  {?Standard Comments}[1]

mlmcc

Author

Commented:
I want the list of values to be available and then if more than one is selected for them to appear in report..

Author

Commented:
Can you help me script that?

Author

Commented:
I think I got it

Making the Parameter optional as well


if  HasValue({?StandardComments})then

join({?StandardComments},chr(13) )
else ''
Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
That should do it.

mlmcc

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial