How to read multivalue control by index

  • 13 January 2016
  • 1 reply
  • 1 view

Badge +3

Dear Expert,

 

How can I read multivalue control by its index number.

 

For Example: I have to send mail to the first two selected person in the Multiselect control.

 

How can I read this value in another control by indexing.

 

Regards

Shah


1 reply

Userlevel 1
Badge +8

Hi Shah

 

I don't think this is something you can do out of the box on a smartform. Most controls that allow multiple values will store the selected values in semi-colon delimited list (e.g. 1;2;8). There is no real way to parse these out and get the first two values in smartforms, unless you can be sure of the length of each element (then you can use Text functions to get values).

 

There are 3 ways I can think to approach this.

 

Firstly, send the controls data to a workflow, and get the workflow to split the values out (there is a Split function available for workflows) and then loop through them and use the first 2 to send emails.

 

Secondly, create your own smartobject method to do the splitting for you. For example you could write a SQL stored procedure or some C# code to return what you need.

 

Thirdly, reconsider your form design so that you don't need to do this. Instead of using a multi select control, use individual controls. 

Reply