How to remove "string;#" from xml when connecting to list view - InfoPath Dev
in

InfoPath Dev

How to remove "string;#" from xml when connecting to list view

Last post 09-14-2010 05:12 PM by pauldwade. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-04-2009 07:20 AM

    • ryn004
    • Not Ranked
    • Joined on 03-04-2009
    • Posts 6

    How to remove "string;#" from xml when connecting to list view

    I am using an xml datasource to bind my infopath dropdown list to my list view with a custom column from a sharpoint list. I've manage to do it however I get "string;#" in front of the value in the dropdown list. e.g. string;#John Smith

     Any solutions? I just wanted to concat 2 columns (firs and last name) into the dopdown list.

     

    thanks.

  • 03-05-2009 03:03 AM In reply to

    • ryn004
    • Not Ranked
    • Joined on 03-04-2009
    • Posts 6

    Re: How to remove "string;#" from xml when connecting to list view

     Solved my own problem using the below code snippet:

                 XPathNodeIterator contactList = DataSources["myDataSource"].CreateNavigator().Select("xmlPath", NamespaceManager);
               
                 foreach (XPathNavigator contact in contactList)
                {
                    string field = contact.SelectSingleNode("myFieldName", NamespaceManager).Value.Replace("string;#", "");
                    contact.SelectSingleNode("myFieldName").SetValue(field);
                }

  • 09-14-2010 05:12 PM In reply to

    Re: How to remove "string;#" from xml when connecting to list view

     I'm a bit new to InfoPath so can you explain where that code snippet goes? Thanks.

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.