Populate Infopath Dropdown Control through Sharepoint List View - InfoPath Dev
in

InfoPath Dev

Populate Infopath Dropdown Control through Sharepoint List View

Last post 01-04-2009 02:57 PM by DummyDumb. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 12-19-2008 07:42 AM

    Populate Infopath Dropdown Control through Sharepoint List View

    Hi,

    I'm trying to populate a Dropdown control in an Infopath Browser Form through a Sharepoint List View. I use a udc file with a query to populate the Display Fields and Values in the Dropdown.

    The query is similar to the following:

    http://bfdev32bit:60000/_vti_bin/owssvr.dll?Cmd=Display&List={0f189d16%2Ddd54%2D453d%2D9d85%2Db03d9ead48d9}&XMLDATA=TRUE&FilterField1=IsSecretary&FilterValue1=0

    which results in:

    - <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">

    - <s:Schema id="RowsetSchema">

    - <s:ElementType name="row" content="eltOnly" rs:CommandTimeout="30">

    - <s:AttributeType name="ows_LinkTitleNoMenu" rs:name="Title" rs:number="1">

    <s:datatype dt:type="string" dt:maxLength="512" />

    </s:AttributeType>

    - <s:AttributeType name="ows_Person" rs:name="Person" rs:number="2">

    <s:datatype dt:type="string" dt:lookup="true" dt:maxLength="512" />

    </s:AttributeType>

    - <s:AttributeType name="ows_IsSecretary" rs:name="IsSecretary" rs:number="3">

    <s:datatype dt:type="boolean" dt:maxLength="1" />

    </s:AttributeType>

    </s:ElementType>

    </s:Schema>

    - <rs:data>

    <z:row ows_Person="20;#Vertriebsleiter1AT" ows_IsSecretary="0" />

    </rs:data>

    </xml>

     

    For display purposes I wan to get rid of the preceding ID in front of the returned value - so 20;#Vertriebsleiter1AT should become Vertriebsleiter1AT.

    Is there a way to do this in the query or in the Infopath Form (I guess I cannot use any string operations like substring as the data is directly pulled from the query so I can only specify the fields in the data source that I want to use.

    Thanks,

    DD

  • 12-19-2008 11:37 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Populate Infopath Dropdown Control through Sharepoint List View

    Hello,

    You want substring of display name for dropdown then we have to do string manipulation in view1.xsl file. Before starting doing this manipulation you have one back up for this form.

    • 1. Open the view1.xsl file in editor mode.
    • 2. Search for dropdown selected value as your display name.

    Example: ‘ows_Person' is the in <xsl:value-of select="@ ows_Person"/>

    Then we have to change like the below,

    <xsl:value-of select="substring(@ows_Person, 5)"/>

    • 3. Save the view1.xsl file and open the form.
  • 12-26-2008 12:33 PM In reply to

    Re: Populate Infopath Dropdown Control through Sharepoint List View

    Hello Shiva,

    Thank you very much for your answer.

    I'll try your proposed solution and will post the result here (might take some days due to christmas time).

    Thanks,

    DD

  • 01-04-2009 02:57 PM In reply to

    Re: Populate Infopath Dropdown Control through Sharepoint List View

    Hello Shiva,

    Your proposed solution works like a charm :-)

    I wasn't sure if edits in view1.xls remain after editing the Infopath Form afterwards, but they do.

    I finally changed the displayed info in the DropDown to the following (therefore it doesn't matter how long the preceding ID is):

    <xsl:value-of select="substring-after(@ows_Person,'#')"/>

    Thank you very much again for the solution - this saved me a lot of time.

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