Determine which subsite called form? - InfoPath Dev
in

InfoPath Dev

Determine which subsite called form?

Last post 12-05-2014 06:38 AM by ChrisJackson19. 38 replies.
Page 1 of 3 (39 items) 1 2 3 Next >
Sort Posts: Previous Next
  • 11-06-2014 08:59 AM

    • klink
    • Top 100 Contributor
    • Joined on 09-15-2014
    • Posts 99

    Determine which subsite called form?

    Is there a way where I can use the same form in several SP subsites and determine on the fly which subsite actually called the form?  The form is web-based...  =)

  • 11-10-2014 01:46 PM In reply to

    • klink
    • Top 100 Contributor
    • Joined on 09-15-2014
    • Posts 99

    Re: Determine which subsite called form?

    Haven't gotten a response on this.  =(  Any thoughts?
  • 11-10-2014 02:06 PM In reply to

    Re: Determine which subsite called form?

    Sorry I missed this!

    So - is the form published directly to the library? Or is it a content type?

    The short answer is "yes" - Open a new browser form and copy the URLout someplace you can ready it - you should see that IPFS has included an input parameter with the URL of the library - I think the parameter is "SaveAs". You could use qRules GetInputParameter to get that value.

    If the form is published to a library there are also built in SharePoint functions in InfoPath that may help you.

    Hilary Stoupa

  • 11-13-2014 06:35 AM In reply to

    • klink
    • Top 100 Contributor
    • Joined on 09-15-2014
    • Posts 99

    Re: Determine which subsite called form?

    This form is an Administrator-approved form template.  The url looks like this:

    /_layouts/FormServer.aspx?XsnLocation=/xxxxx/xxxxx/FormServerTemplates/xxxxx.xxx.xxxxx.xsn&DefaultItemOpen=1">http://<site url>/_layouts/FormServer.aspx?XsnLocation=/xxxxx/xxxxx/FormServerTemplates/xxxxx.xxx.xxxxx.xsn&DefaultItemOpen=1

    I don't see any "SaveAs."  =( 

    This form only submits to SharePoint lists.  No libraries.

    I want to use this form to determine what subsite is calling it, so it can submit the data to the appropriate subsite's list.  I don't want to have to make copies of the form for each subsite.  =(

  • 11-13-2014 07:38 AM In reply to

    Re: Determine which subsite called form?

    Oh - you'll only see the SaveAs if the form is opened from a library that it has been published to.

    You could try putting some calculated values on the form with the various SharePoint functions in them so you could see if any of them return the site.

    Or you could go ahead and set up libraries to use the content type, and then on each subsite, use the library link to the form instead of the admin approved link.

    Hilary Stoupa

  • 11-13-2014 07:49 AM In reply to

    • klink
    • Top 100 Contributor
    • Joined on 09-15-2014
    • Posts 99

    Re: Determine which subsite called form?

    That  makes sense!  I created a library in one of the subsites and used the content type.  Now my form has the sites url!  YAY!

    http://xxx.xxx.org/xxx/xxxy/subsite/_layouts/FormServer.aspx?XsnLocation=http://...

    So, now I should use qRules GetInputParameter to get the value?  Any chance you can point me to the right documentation on how to do this?  =)

    THANKS!

  • 11-13-2014 08:07 AM In reply to

    Re: Determine which subsite called form?

    Well, again, I would start with one of the SharePoint functions built into InfoPath - see if that returns the site. But if you use qRules for this, on the finishedLoading node, if finishedLoading = true, you can use:

    GetInputParameter /key=SaveAs

    and that would return the SaveAs parameter to the Result node.


    Hilary Stoupa

  • 11-13-2014 08:21 AM In reply to

    • klink
    • Top 100 Contributor
    • Joined on 09-15-2014
    • Posts 99

    Re: Determine which subsite called form?

    Well, DOH!  Never used the URL functions before!  Looks like the SharePointSiteUrl() should do it!  I'll be testing that out later today.

    As usual, thanks for ALL OF YOUR HELP! 

  • 11-17-2014 12:12 PM In reply to

    • klink
    • Top 100 Contributor
    • Joined on 09-15-2014
    • Posts 99

    Re: Determine which subsite called form?

    Okay, now that I know which subsite called the form, is there a way to dynamically retrieve data from SP lists depending on which subsite called the form?  I know I could create a separate data connection and just call the one I need, but this form has SEVERAL lists it is pulling from.  =(

    All subsites will be built from the same template, so all lists will have the same names. 

    Ugh, does this make any sense???

  • 11-17-2014 12:57 PM In reply to

    Re: Determine which subsite called form?

    What version of qRules are you using? There just might be a not-currently-documented way for you to do this....

    Hilary Stoupa

  • 11-17-2014 01:05 PM In reply to

    • klink
    • Top 100 Contributor
    • Joined on 09-15-2014
    • Posts 99

    Re: Determine which subsite called form?

    I have the newest version.  =)  Using the trial version, but paid last week! 
  • 11-17-2014 02:18 PM In reply to

    Re: Determine which subsite called form?

    You can use ChangeConnectionUrl with a SharePoint list connection then. :)

    The additional undocumented parameter you need is listguid. This needs to be the GUID for the list you want to query.

    You can get that with the lists.asmx web service: http://msdn.microsoft.com/en-us/library/lists.lists.getlist(v=office.12).aspx

    So - use ChangeConnectionUrl on the connection to lists.asmx to change it to your "current" site. Query the getlist method with your list name and one piece of info you'll get back is the GUID. Use ChangeConnectionUrl with the top secret undocumented listguid parameter for your SharePoint list connection......and you will now be querying your "current" site. :) It sounds more complicated than it is - post back if you get stuck.

    Hilary Stoupa

  • 11-18-2014 05:38 AM In reply to

    • klink
    • Top 100 Contributor
    • Joined on 09-15-2014
    • Posts 99

    Re: Determine which subsite called form?

    ***WARNING***  Mass Confusion Ahead

    So-ooo, huh?

    Currently I "Retrieve data" for the lists using the Data Connection Wizard.  I'm not sure how to get from there to using the super secret undocumented listguid parameter with ChangeConnectionUrl.  =(

    And how do I use the lists.asmx web service?  =(

    I feel like such a doofus...

  • 11-18-2014 07:18 AM In reply to

    Re: Determine which subsite called form?

    Okay, so what I am suggesting is:

    1. Add a SOAP receive connection to the Lists web service - http://YourServer/YourSite/_vti_bin/Lists.asmx
    2. Select the GetList method for that connection
    3. Don't run the connection on load
    4. In form rules, probably on the finishedLoading node, add a qRules command to change the connection URL for that new data connection to the URL for your current site
    5. Next, add a rule to set the query field for the GetList connection to the name of the list you need the GUID for
    6. Query the GetList connection
    7. Use the qRules ChangeConnectionUrl command to change the URL for your SharePoint list connection, using your current site URL, and the list GUID you have gotten back in step 6 - you'll have changed your SharePoint list connection to NOT query on load
    8. Query your SharePoint List connection - the qRules command will have changed it to use your current site's list.

     

    Hilary Stoupa

  • 11-18-2014 09:54 AM In reply to

    • klink
    • Top 100 Contributor
    • Joined on 09-15-2014
    • Posts 99

    Re: Determine which subsite called form?

    Okay...followed until I got to #7.  How did I get the list GUID from step 6?  =/
Page 1 of 3 (39 items) 1 2 3 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.