There is a form with a submit button. I can set out any criteria and if i click on the submit button, the page will go to a view with the search results. I have this “Export to Excel” link which will initiate the export agent written in LotusScript and the data in the page is exported to an excel sheet. The prob comes when a new field which is a text list needs to be introduced in the export sheet. Only the first value in the field gets exported. Ineed to export the whole set of values to the excel sheet.
I used the following code:
If (doctemp.HasItem(“CCTSector”) And doctemp.CCTSector(0) <> “”) Then
supportteam = doctemp.CCTSector(0)
Else
supportteam = ""
End If
Here CCTSector is the list field. And support team is the variable that will be exported to excel.
you explicitly tell LotusScript to only use the element at index 0 of the array that is used to access the values in a Notes item. If you omit “0”, a variant containing an array of all values is returned.
If and how you have to further process this array depends on what else your code does.
Sorry for not being more specific about it. As you found out by now, you have to use this syntax
supportteam = doctemp.CCTSector
Anyhow, great you could resolve it. The thing is, that for LotusScript, each item in a note is an array, be it multi-value or not. That’s why you need to add (0) most of the time (if all you want is the first element in that array), but not always.