in

InfoPath Dev

Query SharePoint List for Specfic Value InfoPath 2007 Browser Form

Last post 07-22-2008 08:48 AM by Hilary Stoupa. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 07-14-2008 05:06 PM

    Query SharePoint List for Specfic Value InfoPath 2007 Browser Form

    Anyone know if I can query a SharePoint list on open to see if a specifc value is in that list? If found I want to put the value in a field. Based on that field not being blank I can show a hidden section of the form. Example a List of Approvers. I know how to get the current users SharePoint profile so I can use login name to see if login name is in my list of approvers. This is a browser based form.

  • 07-14-2008 10:36 PM In reply to

    Re: Query SharePoint List for Specfic Value InfoPath 2007 Browser Form

    This is difficult with a browser form since you cannot use a filter.

    I am not thinking of a way to do it since you cannot query the list like you could a web service to SQL or Active Directory.

  • 07-16-2008 07:29 AM In reply to

    Re: Query SharePoint List for Specfic Value InfoPath 2007 Browser Form

    Hi --

    I haven't worked with browser based forms much, but I believe you can have Open rules on them -- If you set your data connection up to automatically query on open, you could then use an open rule with a condition to fill your field.

    Hilary Stoupa / InfoPath Developer
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 07-16-2008 07:48 AM In reply to

    Re: Query SharePoint List for Specfic Value InfoPath 2007 Browser Form

    Thanks for your replay.  Hmm I'm trying to think how that would work. Its easy enough to set the SharePoint data connection  to run on open to get the Sharepoint list. I also have a web service data connection that runs on open to get the current user. The problem is I'm trying to match the current users name to a name in the list and the list returns more than one person. So how do I tell if that person is in the list? So I wanted to get the current user and pass that user into the query to select from the list but I don't think you can send parameters to a SharePoint list data connection in InfoPath.

     In a client based form I put the current user in a hidden field and then filter the SharePoint data connection by that field. If its empty then the person is not in the list if not then they are ok but you can't use filters in browser forms.  Not sure why but I know you can't. Seems like an important piece of missing functionality.

  • 07-16-2008 08:04 AM In reply to

    Re: Query SharePoint List for Specfic Value InfoPath 2007 Browser Form

    I did a simple test -- pulled a list from a SharePoint site and set a condition on the rule that the ID had to equal 2 for my test field to be filled with a test value. There was an item with an ID of 2 and my field was filled. Then I changed the condition to 3, again, there was an item with an ID of 3 and the field was filled. Finally, I changed the condition to 4, and since there was no item with an ID of 4, my test field was not filled.

    So, I think your condition could be as simple as whether the field associated with the list is equal to the field with your user name -- if so, set a value on another node (that doesn't even have to be on your form, just a simple boolean flag would work) and base the visibility of your hidden section off that...

    Hilary Stoupa / InfoPath Developer
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 07-16-2008 08:27 AM In reply to

    Re: Query SharePoint List for Specfic Value InfoPath 2007 Browser Form

    Great! Thank you so much I will try this. Hopefully I can return the favor someday. I've run into many issue with browser forms that require a work around but most can be accomplished without too much work its just figuring out how to do it.

  • 07-22-2008 08:39 AM In reply to

    Re: Query SharePoint List for Specfic Value InfoPath 2007 Browser Form

    I tried this and it doesn't seem to work for me. Not sure where you are setting the rule. On the list field or the field you are filling or the field you are testing against. In any case it does't work unless you select something in the list first. I want to just query the list to see if the current user is in it. The only fields in the list is user name and the Current User field is set to user name but if the current user is in the list the rule does not fire until the current user is selected in the list. Not what I want.

  • 07-22-2008 08:48 AM In reply to

    Re: Query SharePoint List for Specfic Value InfoPath 2007 Browser Form

    What about an Open rule -- under Tools/Form Options/Open and Save.

    Hilary Stoupa / InfoPath Developer
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (8 items)
Copyright © 2003-2007 Qdabra Software. All rights reserved.
View our Terms of Use.