open an infopath form with a choice preselected in dropdown box via URL - InfoPath Dev
in

InfoPath Dev

open an infopath form with a choice preselected in dropdown box via URL

Last post 01-18-2011 01:17 PM by Pcheru. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 04-15-2009 03:07 PM

    open an infopath form with a choice preselected in dropdown box via URL

    Hi there,

    I have created an browser capable infopath form with the first two dropdowns pulling values from a sharepoint data source each..
    We need to do 3 things:
    1) have the corresponding value in dropdown preselected when the form is opened from a hyperlink of corresponding sharepoint webpage. The page's "Title" field / column contains the same data / choice as we need to use in the form..

    2) have the options in this dropdown sorted alphabetically (the sharepoint list they are being pulled from is sorted by title ascending in default view but this isn't pushing through to the infopath dropdown)

    3) have some validation that if there is a value entered in the first dropdown the second dropdown can be blank and vice versa, but both dropdowns cannot be blank.. We also need to do some more advanced validation similar to this but this would probably lead us in right direction..

    Any help with thes would be much appreciated :)

  • 04-16-2009 10:53 AM In reply to

    Re: open an infopath form with a choice preselected in dropdown box via URL

    Not sure on #1.  I am not sure what you have in place that opens new forms from a single library but originates from multiple webpages.

    2) You need to make a data connection to the XML version of the list.  When you do this, the data is defined before coming to the form, which means it will be sorted, filtered, and will have the same columns as whatever view you connect to in the list.  Instructions on this can be found here.

    3) What I do is NOT set either field to be required, but rather place conditional formatting on my submit button (custom button on the form - no code, just rules) that makes the button not show up unless all criteria are met.  Once the criteria are met, the button is available for submission.  You can easily set the necessary conditions so that the button is disabled if both dropdowns are blank.  What this does is make it impossible to submit with mistakes, and the user never gets a validation error after trying to submit an invalid form, which is what happens when using the built-in "cannot be blank" option.

  • 04-16-2009 05:30 PM In reply to

    Re: open an infopath form with a choice preselected in dropdown box via URL

    1) we have about a hundred pages and 100 options for these two boxes.. If the user clicks the hyperlink from one webpage with sharepoint column 'title' = bob we'd like the dropdown to also default to bob..

     2) thanks for this -I tried the technique in the instructions which generated http://contoso.com/Lists/ItemList/_vti_bin/owssvr.dll?Cmd=Display&List={3D3F2EF0-A3F1-4049-BFFF-E6BCFA3888DE}
    however when I pasted this into my browser I get an error: Cannot complete this action.

    3)  sounds a good option except that we have about 40-50 fields to use on this form, so if we used this method how would the user know which field they have fillout out incorrectly or why the submit button isn't enabled..?
  • 04-16-2009 05:38 PM In reply to

    Re: open an infopath form with a choice preselected in dropdown box via URL

    1) I cannot fathom such a setup or how it is even possible, so either it's beyond my abilities/knowledge, or I just don't understand what you mean.

    2) It definitely works - you just have to get the URL right.  I don't think "Lists/ItemList" gets included in the URL - just the site URL - because the OWSSVR&List part defines the list itself, not the URL.

    3) I would consider that many required fields to be completely unreasonable, so maybe it's not a good solution, but I can't think of anything that's good for that many required fields.  That's just incredible.  If you really had to, you could have an extra confirmation box with conditional formatting that makes the red star go away whenever a field is successfully completed, and if they have any red stars left, then they know what parts are incomplete.

  • 04-19-2009 06:12 PM In reply to

    Re: open an infopath form with a choice preselected in dropdown box via URL

    1) maybe im not explaining it very well sorry.. We can have a single hyperlink to the browser compatible form which opens with no boxes filled in, but I'm wondering can we use a different hyperlink to have one of the dropdown options selected by default..?

    2) I've tried several different combinations of URL's but they are all giving the same error.. Is there some other method I can use to sort the data in this dropdown box?

    3) Yes there's a lot of required fields (26 compolsory and at least that many again not compulsory).. This is the existing .asp form I am trying to replicate using infopath here..
    I think the most tricky validation we'd like to have is (a) if one radio button is selected such as 'other' then ensuring something is typed into the textbox next to it, (b) if ethnicity dropdown is a certain value then the next textbox contains info, (c) ensuring a programme is selected from one of two dropdowns, and if not that an 'other' textbox contains info...
    If it's easier could we combine the data from two separate lists / dropdowns into one (as we are doing with our .asp form)

     

    Thanks for all your help with this

  • 01-14-2011 08:01 AM In reply to

    Re: open an infopath form with a choice preselected in dropdown box via URL

    Can somebody please help me with something similar to this

    This is my flow:

     I have a form with pre-populated user name and email address. the requestor comes in places the request and clicks on Submit to send it to the SP library. Before exiting, another view of the Infopath form opens with an option to "Add Another Request".

    When this button("Add Another Request") is clicked, I am able to open the form template existing in the associated library. But, my ask is this form opened by clicking the button should have the project name field populated with the project name previously submitted by the same user.

    Thank you in advance!!!!!!!!!!

  • 01-15-2011 05:58 AM In reply to

    Re: open an infopath form with a choice preselected in dropdown box via URL

    Hi Pcheru,

    Where is the project name data for that user being saved? Is it in an XML file that the user filled out and submitted? Is it in the same form library or a different one? You will need to query that data and then filter based on current user. If the previous user only has one project name associated with them, it will be easy, otherwise you'll have to figure out which one to give them. Maybe a dropdown is good in that case and they can just select from their previous.

    If you have many users or previous projects (>200) you probably don't want to filter in the form. I recommend looking at FilterOwssvr to allow you to do server side filtering. To make this dynamic (based on currently logged in user) you'll have to either write code or use qRules 2.4 which will give you FilterOwssvr and a whole lot more.

    Good luck!

    Patrick Halstead
    Project Manager at Qdabra
  • 01-18-2011 01:17 PM In reply to

    Re: open an infopath form with a choice preselected in dropdown box via URL

    Hi Patrick,

    The project name is stored in the Infopath form submitted and also in the Web Service.

    It is being submitted to the same library. I dont want all the projects the user has been associated with but just the last project he has submitted. I tried retrieving the data from the project name node of the Web Service/XML file but am not really successful. I will try using FilterOwssvr and will let you know how I fared.

    Thank you!!

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