Use a field in InfoPath for a column in sharepoint? - InfoPath Dev
in

InfoPath Dev

Use a field in InfoPath for a column in sharepoint?

Last post 01-09-2009 04:06 AM by swathip. 11 replies.
Page 1 of 1 (12 items)
Sort Posts: Previous Next
  • 01-06-2009 02:24 AM

    Use a field in InfoPath for a column in sharepoint?

    Hi there, hope someone can help.

    When a form is published there's the option that lets you select fields to be columns in a SharePoint library, it only seems to let you select from the Main data connection and what's in that.

    I have an ID field in there that's populated by a drop down list in the form. The drop down list data is taken from another data connection that retrieves a table from the database. it has an ID column and a Name column. The problem I have is that the Name column is not in the Main data connection.... only the ID because it's a foreign key taken from the other data connection.

    When I publish my form to a library in Sharepoint I want to use the Name field as a column in the library, however, it seems I can only choose from the Main data connection and that only has the ID field.

    Is there a way to be able to select from the Name field?   I could just redevelop the database and use the name column rather than the ID column but I want to know if there's an alternative.

     Hope this all makes sense and thanks

    ____________________________________

    Take a deep breath phsssssssssss
  • 01-06-2009 02:35 AM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Use a field in InfoPath for a column in sharepoint?

    Hi,

    Add Name field to the main data source and get the data from db when you get the ID value and save it in Name field. So, now you can ble to promote that Name value now.

    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 01-06-2009 03:22 AM In reply to

    Re: Use a field in InfoPath for a column in sharepoint?

    I would go for Anuma's solutions

     Another option is to add a coluémn and make a data lookup in SharePoint.

    Frederik

    Frederik Van Lierde
    Blue InfoPath Blog  ¦  SilverSands Associate  ¦  Do you follow me already?  ¦  We work smart, not hard


    If this article was helpfull, don't forget to rate it, tnx!
  • 01-06-2009 03:39 AM In reply to

    Re: Use a field in InfoPath for a column in sharepoint?

    Thanks for getting back to me.

     Anuma, In regards to adding the Name field to the Main data connectio, do you mean adding the Name field to one of the tables in the db that is represented in the Main connection? If that's the case, I'm trying to avoid using an extra field in the db and would rather use the ID as the FK rather than the Name... If I've got it wrong, apologies.

     Frederik, I'm not sure I know how to do this, could you maybe guid me a little.

    Again, thanks for your help.

     

    Paul

    ____________________________________

    Take a deep breath phsssssssssss
  • 01-06-2009 03:49 AM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Use a field in InfoPath for a column in sharepoint?

    Hi,

    Add "Name" field to the main data source in the form not in the DB.

    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 01-06-2009 05:13 AM In reply to

    Re: Use a field in InfoPath for a column in sharepoint?

    Ah, I understand now, Thanks, that worked a treat

     Paul

    ____________________________________

    Take a deep breath phsssssssssss
  • 01-07-2009 09:50 PM In reply to

    • PeterD
    • Not Ranked
      Male
    • Joined on 01-08-2009
    • Australia
    • Posts 3

    Re: Use a field in InfoPath for a column in sharepoint?

    Hi,

    I have exactly the same problem. I want to promote the 'display name' (not the ID value) from an InfoPath dropdown list to a column in sharepoint.

    Can someone please explain, in more detail, how to Add "Name" field to the main data source in the form not in the DB.

    In my case, the main data source is a Web Service.

    Do I need to add the field to the Web Service (but just don't save it to the DB) ?
    How does this new field get populated when a user selects an entry from the dropdown list?

    Appreciate any help.

    Peter

  • 01-07-2009 11:09 PM In reply to

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

    Re: Use a field in InfoPath for a column in sharepoint?

    Hello Welcome to the Forums,

    You have to add the Name field to main schema in the same level of ID field. You have to add the rule on ID field to set the DisplayName value to newly added Name field. In this we have to add the filter condition as selecting secondary DisplayName (ID is equal to main DOM ID field).

  • 01-07-2009 11:56 PM In reply to

    Re: Use a field in InfoPath for a column in sharepoint?

    Hi,

    Yes, in your case you need to add the field to webservice and don't save in the DB. And add a rule to this field as shiva said.

    Swathip
    www.ggktech.com
  • 01-08-2009 05:06 PM In reply to

    • PeterD
    • Not Ranked
      Male
    • Joined on 01-08-2009
    • Australia
    • Posts 3

    Re: Use a field in InfoPath for a column in sharepoint?

    Thank you Shiva and Swathip,

    I have added the Display Name to the Web Service, so both the LocationID and Location appear as fields in the main data source.

    However, I'm still unclear about how to add the rule to the LocationID so that the new form field Location gets populated.

    This is what Swathip said -
    You have to add the rule on ID field to set the DisplayName value to newly added Name field. In this we have to add the filter condition as selecting secondary DisplayName (ID is equal to main DOM ID field).

    Here is what I'm looking at:

    1. Right click LocationID form field and select Drop-Down List Box Properties.
      • Value: ns1LLocationID
      • Display name: ns1:LocationName
    2. Click Rules button
    3. Click Add button on Rules screen
    4. Click Add Action on Rule screen
    5. Fill out Action screen
      • Action: Set a field's value
      • Field: Location
      • Value: I click insert formula, but don't know what to enter (Insert Field or Group, or Insert Function)

    Any help appreciated.

    Thanks,

    Peter

  • 01-08-2009 07:50 PM In reply to

    • PeterD
    • Not Ranked
      Male
    • Joined on 01-08-2009
    • Australia
    • Posts 3

    Re: Use a field in InfoPath for a column in sharepoint?


    Okay, I figured out how to add the appropriate rule to solve the problem described in my previous post.

    In the Action box for the rule, the text should look like

    Set a field's value: Location = LocationName[LocationID = LocationID]

    In my case, the dropdown list is a set of Locations.  If your dropdown box was a list of say Books, then the text would be
    Set a field's value: Book = BookName[BookID = BookID]

    To make this work, you need to link the LocationID from the main datasource to the datasource that provides the list of values. You do this by clicking on the Filter Data box and joining the two records.

    Hope this helps others wrestling with the same problem.


    Regards,
    Peter

  • 01-09-2009 04:06 AM In reply to

    Re: Use a field in InfoPath for a column in sharepoint?

    Hi,

    I am glad to hear that you got it. And thanks for placing the solution here.

     

    Swathip
    www.ggktech.com
Page 1 of 1 (12 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.