Datatype of output argument of a form activity
Hi,
I have a Listbox in a form. I gave an argument name so that I can collect output arguments of selected list box item. I set the type of variable for output argument as 'Object' and I am getting the value of the selected listboxitem into the variable.
What I am looking for is to get the Display name of the listbox dataitem along with the value. How should I cast my output argument which is an object to achieve this
Thanks:)
Srikanth
0
-
Hi Srikanth,
From my knowledge form activity only returns value and not associated display value.
We have similar scenarios in our workflows and after form activity we are querying database or mapService to retrieve associated display value.
To cast selected value you can use cast activity to type System.Collections.Generic.IList<System.Object> then use a ForEach<Object> activity to loop the casted list and retrieve values using item.ToString() or Convert.To...(item) if your values need to be of a particular type (integer, ...)
If your listbox allows only single selection mode you can cast it directly using .ToString() or Convert.To....()
I hope this helps
Francesca0 -
Hi Srikanth,
Yes, the ListBox output argument will only return string value in case of single selection and string collection in case of multiple selection.
Regards,
Mohammad Ashraf0
Please sign in to leave a comment.
Comments
2 comments