workflow to get the value of Lookup field

In Visual Studio 2008.

I was trying to get the value of Lookup field in a Document Library and would see a result like this:

sLookup = workflowProperties.Item(“FieldName”).ToString

but it returns: 9;#FieldValue

This is how I went about fixing the string (if there is a better way, please tell me!)

sLookup = Right(workflowProperties.Item(“FieldName”).ToString, Len(workflowProperties.Item(“FieldName”).ToString) – InStr(workflowProperties.Item(“FieldName”).ToString, “#”))

This entry was posted in SharePoint by Ian Hayse. Bookmark the permalink.

About Ian Hayse

SharePoint Admin. SharePoint Guy. I have been working with SharePoint nonstop for the past six years. In those six years, I've done everything from 'normal' Admin work, development, migrations, training, planning, search, workflow, InfoPath, to crazy fixing of the hands-off SharePoint databases. I'm located in Austin, TX and can always help out with small projects.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>