Inserting dynamic value into REST URL - contains "" - InfoPath Dev Sign in | Join | Help in Web Services InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Web Services » Inserting dynamic value into REST URL - contains "" 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: Oldest to newest Newest to oldest Previous Next 09-24-2013 01:29 PM jbrandenburg Joined on 06-21-2012 Posts 24 Inserting dynamic value into REST URL - contains "" Reply Contact 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! Filed under: SharePoint List, infopath 2010, Infopath web services, rest 09-29-2013 10:17 PM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: Inserting dynamic value into REST URL - contains "" Mark as Not AnswerMark as Answer... Reply Contact 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 MVPQdabra Software 09-30-2013 07:41 AM In reply to jbrandenburg Joined on 06-21-2012 Posts 24 Re: Inserting dynamic value into REST URL - contains "" Mark as Not AnswerMark as Answer... Reply Contact 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.
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")
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