O'Reilly logo

Professional K2 blackpearl® by Mike Talley, Eric Schaffer, Anthony Petro, Chris O'Connor, Colin Murphy, Jason Montgomery, Gabriel Malherbe, Igor Macori, Shaun Leisegang, Codi Kaji, Chris Geier, Sergio Del Piccolo, Jason Apergis, Holly Anderson, Paul Turley, Chris Leiter, Dan Wood

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix A. K2 blackpearl Tips and Tricks

When we started this book, we wanted to make sure that everyone who read it came away with some good information, not only from the information contained within each chapter but also from the insight each author provides. That in great part explains why the authors were chosen to participate. They come from a variety of fields and have a variety of experiences that should help you take advantage of the K2 platform. To further this idea we have collected various tips, tricks, and "how-to" information from a broader audience, including K2 employees from around the world and community representatives who have discovered some great time-saving techniques. Some of these things you may have seen before on various K2 blogs. Others will be new. We hope you find many of them useful.

Retrieving the Value from an XML Field Element

By Joseph Dunagan, K2 Consultant

Sometimes you need to get the value from an element within a K2 XML field. This is usually done within a server event. In the following example, I needed to retrieve a URL from a K2-generated XML field. This specific example should work if you do not expect repeating values in the Items node. For scenarios where repeating values are selected, you would need to change the XPath.

// get the full XML from the K2 XML field string strXML = K2.ProcessInstance.XmlFields["SPEventsField"].Value; // set the XPath to the desired node string strXPath = "/Items/Item/URL"; // use the helper class to retrieve ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required