Build Dynamic string to be use to filter REST Web Service Data Connection to a SharePoint List - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Build Dynamic string to be use to filter REST Web Service Data Connection to a SharePoint List

Last post 09-01-2015 05:38 PM by Hilary Stoupa. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 08-26-2015 10:24 PM

    Build Dynamic string to be use to filter REST Web Service Data Connection to a SharePoint List

    Hi,

    Good day. I just want to inquire if Qrules do have a command to build dynamic URL that can be use to change REST URL to filter a SharePoint List.

    An example would be as below.

    I have 3 Dropdown as below. The value of the dropdowns needs to be use as a filter value in changing the REST URL connection to the SharePoint List. This would work fine if all the 3 dropdown all have values, I can build the URL as concat(http://servername/_vti_bin/ListData.svc/ListName?$filter=Product eq", "'",ProductValue,"'", "and Category eq", "'",CategoryValue,"'", "and Brand eq", "'",BrandValue,"'", "")

     

    Product: Gadget

    Category:

    Brand: mybrand

     

    Is there a command in Qrules to make the above work if one of the dropdown is blank?

     

    Regards,

    Rommel 

  • 08-27-2015 08:13 AM In reply to

    Re: Build Dynamic string to be use to filter REST Web Service Data Connection to a SharePoint List

     No, I don't think so - I think you just need separate rules for setting the URL based on the possible combinations - or you could probably use a complex substring formula (like the one outlined here - http://blogs.msdn.com/b/infopath/archive/2006/11/27/conditional-default-values.aspx).

    I'd probably add a secondary XML form logic data source for this and just use rules - see the attached file.

    Hilary Stoupa

  • 08-27-2015 02:44 PM In reply to

    Re: Build Dynamic string to be use to filter REST Web Service Data Connection to a SharePoint List

    Hi Hilary,

     The form that you had sent is what exactly I needed for the logic. I'm not so familiar regarding the secondary XML data source so I may need to check how it works. Do you have a blog or a link for example where I can read through to learn how to use the similar XML source that you had use on the form.

     

    Thank you once again for the help.

     

    Regards,

    Rommel 

  • 08-27-2015 03:12 PM In reply to

    Re: Build Dynamic string to be use to filter REST Web Service Data Connection to a SharePoint List

    Well - you can export that exact same XML under the Resource files in the Data tab in the ribbon for the form. You can then import it into your form, and add a data connection to it. From there, you simply need to implement the same rules. :)
    Hilary Stoupa

  • 09-01-2015 12:54 AM In reply to

    Re: Build Dynamic string to be use to filter REST Web Service Data Connection to a SharePoint List

    Hi Hilary,

    Good day. I did try to use the form that you had sent but when I use the "REST Url with Filter" from the XML data source as the value to change the REST URL and requery the data connection, I'm getting the below error.

     XML data that is required for this form to function correctly cannot be found.

    An entry has been added to the Windows event log of the server.


    Log ID:5566

     

    Am I doing something wrong. Kindly advise.

     

    Regards,

    Rommel 

  • 09-01-2015 08:07 AM In reply to

    Re: Build Dynamic string to be use to filter REST Web Service Data Connection to a SharePoint List

    Can I see your form? You can attach it under Options in a reply.
    Hilary Stoupa

  • 09-01-2015 02:52 PM In reply to

    Re: Build Dynamic string to be use to filter REST Web Service Data Connection to a SharePoint List

    Hi Hilary,

    Good day. I had attached my form now. But the connection to the dropdown are all connection to a sharepoint list. Please let me know if I need to provide anything else.

     

    Regards,

    Rommel 

  • 09-01-2015 03:00 PM In reply to

    Re: Build Dynamic string to be use to filter REST Web Service Data Connection to a SharePoint List

     I took a quick look at your logic and it appears ok - what is the URL you are getting in the REST Url With Filter field?

    Hilary Stoupa

  • 09-01-2015 03:16 PM In reply to

    Re: Build Dynamic string to be use to filter REST Web Service Data Connection to a SharePoint List

    Hi Hilary,

    Attached is the result if I put some filter value. 

    Also, the form has another view called PM. I'm using the same process in filtering on it that when the dropdown change, I'm building the below REST URL as below and this is working fine

     

    concat("https://home.smecnet.com/sites/itcdev/debtors/_vti_bin/ListData.svc/WIPWorkbench?$filter=ProjectManager eq ", "'", ., "'", "")

     

     


  • 09-01-2015 03:22 PM In reply to

    Re: Build Dynamic string to be use to filter REST Web Service Data Connection to a SharePoint List

    Sorry, I'm confused - in the screenshot above, when you click the button in that view, you get the error "XML data that is required for this form to function correctly cannot be found"?
    Hilary Stoupa

  • 09-01-2015 03:47 PM In reply to

    Re: Build Dynamic string to be use to filter REST Web Service Data Connection to a SharePoint List

    Yes Hilary, the error happens when I click the button.

  • 09-01-2015 03:53 PM In reply to

    Re: Build Dynamic string to be use to filter REST Web Service Data Connection to a SharePoint List

    It looks like a valid REST URL, to me at least. I'm assuming you also get an error if you paste this URL into your browser's address bar?
    Hilary Stoupa

  • 09-01-2015 04:02 PM In reply to

    Re: Build Dynamic string to be use to filter REST Web Service Data Connection to a SharePoint List

    Yes an error also happens. but on the form that I had sent you and on the PM view (page), when I build the REST URL using the below process, it is working fine. not sure why it is not working on the MGT View.

     

    concat("https://home.smecnet.com/sites/itcdev/debtors/_vti_bin/ListData.svc/WIPWorkbench?$filter=ProjectManager eq ", "'", ., "'", "")

     

  • 09-01-2015 04:20 PM In reply to

    Re: Build Dynamic string to be use to filter REST Web Service Data Connection to a SharePoint List

    Hi Hilary,

    Sorry about this, I had figure out and it is my mistake. The issue is on the list name, it should be "WIPWorkbench" and what is in my secondary XML data connection is "WipWorkbench", and from this I learn that it is case sensitive.

     

    Thank you once again for having a look into this and sorry as it is my mistake in configuration.. 

  • 09-01-2015 05:38 PM In reply to

    Re: Build Dynamic string to be use to filter REST Web Service Data Connection to a SharePoint List

    Nothing to apologize for - good eye to catch that, and great to know about it being case sensitive.
    Hilary Stoupa

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