Store a dropdown value from a secondary data source - InfoPath Dev
in

InfoPath Dev

Store a dropdown value from a secondary data source

Last post 07-05-2012 10:16 AM by Hilary Stoupa. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 06-29-2012 07:16 AM

    Store a dropdown value from a secondary data source

    I have an InfoPath form (Requests) with various sections that need to be displayed or not depending on the item code that is selected. The 'Item Code' list has a look up to a list called 'Units' which has a look up to a 'Unit Type' list. The InfoPath form is based on another list called Requests i.e. it does not contain 'Unit' or 'Unit Type' fields only the 'Item Code' field. The problem I have is I need to store the 'Unit Type' number within the form so that I can filter the 'Unit Type' list for a display 'Yes' or 'No' value. The 'Unit Type' number is filtered OK in the dropdown, but if I try to duplicate this field or set a field value it returns the 'Unit' ID not the 'Unit Type' number. i.e. there are over 100 Units - but only 10 Unit Types. So for example 'Unit' ID55 has a lookup of 'Unit Type' 6 which means Display 'Yes'. Unit ID 6 has a Unit Type of 3 which means Display 'No' Hopefully this makes sense? Long story short! How do I store a number from a filtered Secondary Data source within my InfoPath form?
  • 06-29-2012 12:15 PM In reply to

    Re: Store a dropdown value from a secondary data source

    You use a rule or a default value to set the target field (in your main data source) to the same filtered value you are displaying. I had a little trouble following your explanation (sorry, I know you were trying to be complete!), but I think you are saying that your Unit Type list has a field named Unit Type, and you need to set a form field to the value of Unit Type based on ... ? Selected Item Code? Selected Unit?

    At any rate, you'll use a default value or a rule - and set it to the filtered value you need - feel free to attach a sample template under the Options tab and I can give you a hand, okay?

    Hilary Stoupa

  • 07-02-2012 12:22 AM In reply to

    Re: Store a dropdown value from a secondary data source

    Hilary - first of all many thanks for your swift reply and advice. Brilliant! I will try out your suggestion this morning and let you know how it goes. If i post you a template, how do you get the interactions with the various lists? This may be an unnecessary explanation... however I'd like to get better at explaining and give at a go. OK here goes... If i select an Item Code in SharePoint form. This looks up a Units list (Title) e.g. ABC. DEF, etc. This Units list corresponds to a Unit type e.g. Bulldozzer, Crane, Boat etc. in the Unit Types List. If i choose ABC - which e.g. corresponds to Boat - i require no wheels therefore wheels should not be displayed on my InfoPath form to print. (There are 221 Units but only 10 unit types). The problems i am experiencing is that because it is a display form - no buttons - triggering anything is a problem. I have used on form load - which has got me so far. And the storing of the Unit Type value to allow filtering on what sections of InfoPath form to display. If Boat - No Wheels on InfoPath Form. If Crane - Yellow Paint and Wheels should appear on InfoPath Form. I will try your suggestion..I'm probably over complating things. Many thanks - I'll let you know how it goes.
  • 07-02-2012 08:58 AM In reply to

    Re: Store a dropdown value from a secondary data source

    Well, I wouldn't be able to preview, but I should be able to help you with the XPath just from design mode.

    Hilary Stoupa

  • 07-03-2012 03:28 AM In reply to

    Re: Store a dropdown value from a secondary data source

    Hi Hilary I have included the template file. Field 1 returns the correct value (1-10 from the Unit Types list). the other fields are me trying to store this result (so that i can filter the Unit Types list), but i only get the ID value from Units (1-221). I can seem to store the Unit Types number. My intention is to wrap each question within an InfoPath section so that it can display the question or not (format rule) - depending on what field 1 returns. If user selects Item Code - ABC (ABC comes from the Units List -221 entries) then this Unit/Item Code corresponds to 10 entries within the Unit Type List. The Unit Type list has 47 columns which correspond to the questions in the InfoPath form. i.e. displayQ1 - y/n. Hide this control if displayQ1 is Yes etc. I will have time this evening to either explain or try your suggestion. Many thanks again. David
  • 07-04-2012 11:48 AM In reply to

    Re: Store a dropdown value from a secondary data source

    Hi Hilary I have had a chance to solve the problem. And it works! I don't know where to begin...! An on load rule.. to set a field value within form (main data connection). this field value was based on the filtered values of Units and Unit Types (these were secondary added data connections, with the correct columns and filters (the returned value was based on the Unit Data connection filtered on the ID of the Item Code in the Main connection to return the display boolean within the Unit Types. Easy!). I then used this value to filter the the Unit Types to provide whether I should display Q1 or Q2 or Qx etc. Not straightforward, not easy to explain either. Thanks for your all your help though. Kind regards David
  • 07-05-2012 07:16 AM In reply to

    Re: Store a dropdown value from a secondary data source

     Hello, David,
    wanted to help but I see you already coped. Glad for you!

    I see from your template that you are using Sharepoint Online (Office 365) and custom (wizard or manual) data connections above default closed Main Data Connection to a sharepoint online list.

    I am curious are you able to get data through custom data connections when running your form locally, i.e. by Preview or F5  (which is equivalent to running it as Infopath client or Filler form) or as client (Filler) form? 

    Whenever I add such custom data connections in Infopath form, the access to data received from Sharepoint lists (through them) in client form is being blocked in  until I change the security level (in Infopath Designer 200 (in backstage File--> Info-->Form Options --> Security and Trust) to 

    • Full Trust (the form has access to files and settings on the computer)
      For a form to run with Full Trust in Infopath Filler, it must be installed or digitally signed with a certificate. Some Web Browse forms require full trust if they contain code, and must be deployed by a server administrator
    • having unchecked for this "Automatically determine security level (recommended)" checkbox

     but this means that it is impossible to use such Infopath client/Filler forms (with custom Sharepoint list data connections) in Office 365 (Sharepoint Online)?
    See also my question:

    Gennady Vanin (Novosibirsk) --- Геннадий Ванин (Новосибирск)
  • 07-05-2012 10:16 AM In reply to

    Re: Store a dropdown value from a secondary data source

    Hey, great work - sorry I couldn't get back to this sooner, but I'm glad you were able to work it out!

    Hilary Stoupa

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