Inserting dynamic value into REST URL - contains "" - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Inserting dynamic value into REST URL - contains ""

Last post 09-30-2013 07:41 AM by jbrandenburg. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-24-2013 01:29 PM

    Inserting dynamic value into REST URL - contains ""

    Hi - I have a data source I would like to filter with a simple search box. By pressing a 'search' button I want to insert the value in the search box into the rest URL and query the data source so only the searched results appear in the dropdown box. The problem I am having is determining where/how to coordinate the quotation marks to get the formula to work properly. Here is the formula with hard coded data: "webapp/_vti_bin/listdata.svc/ProjectList?$filter=substringof('1001',ProjectIDAndTitle)". ***This works properly, so I want to insert my field which translates into this: "webapp/_vti_bin/listdata.svc/ProjectList?$filter=substringof(xdXDocument:GetDOM('Projectsearch')/FormLogic/Values/ProjectSearch,ProjectIDAndTitle)" This results in error due to the quotation marks around 'Projectsearch'. How can I avoid the error? Thank you!
  • 09-29-2013 10:17 PM In reply to

    Re: Inserting dynamic value into REST URL - contains ""

     That URL isn't going to work because listdata.svc has no idea how to access the contents of your FormLogic data source. You need to use concat() to patch the URL together (you would enter this in the formula builder dialog):

     concat("webapp/_vti_bin/listdata.svc/ProjectList?$filter=substringof('", xdXDocument:GetDOM('Projectsearch')/FormLogic/Values/ProjectSearch, "',ProjectIDAndTitle")

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-30-2013 07:41 AM In reply to

    Re: Inserting dynamic value into REST URL - contains ""

    That worked great.  Thank you very much, Jimmy!

    The final working URL was:

     concat("http://webapp/_vti_bin/listdata.svc/ProjectList?$filter=substringof('", ProjectSearch, "',", "ProjectIDAndTitle", ")")

     Thanks again!

    Jesse

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