REST API not querying result in InfoPath Web Form though it work fine in InfoPath Designer preview!!! - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

REST API not querying result in InfoPath Web Form though it work fine in InfoPath Designer preview!!!

Last post 06-04-2017 04:11 AM by 2shahid.hashmi@gmail.com. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 05-31-2017 01:08 AM

    REST API not querying result in InfoPath Web Form though it work fine in InfoPath Designer preview!!!

    I am trying to query a SharePoint 2013 list from InfoPath 2013 WebForm. I took the reference from johnliu’s blog.
    1. Created a Data connection “Rest_Equipments” to query the list using following filter
    http://MyURL /_vti_bin/listdata.svc/Equipment_No?$filter=Unit%20eq%20'UNIT00-EOH'
    2. Created one more “list” data connection called “Units” to bring “Unit numbers” for lookup from SharePoint list
    3. Created a Drop-Down List box “Unit Number” to show the available Unit numbers using Units data connection
    4. On selection of “Unit Number” created following rule to change the Rest URL & query
      i. concat("http://MyURL/_vti_bin/listdata.svc/Equipment_No?$filter=Unit%20eq%20'", Unit Number, "'")
      ii. Query using data connection “Rest_Equipments”
    5. Created a Drop-Down List box which is fetching “Equipment Number” from External data source “Rest_Equipments”, this should bring the result as per 4. -> i.
    It works as expected in the InfoPath Designer preview, but it does not return any results after publishing & opening it in browser, and there is no error as well. Can someone point at what may be going wrong here?


    Thanks in Advance
    Shahid
  • 05-31-2017 08:00 AM In reply to

    Re: REST API not querying result in InfoPath Web Form though it work fine in InfoPath Designer preview!!!

    Interesting that there is no error - if the query failed to execute due to loopback check I'd expect an error. If you put the data fields from the secondary data source on the form so you can see them in the browser form, does any data get populated? What about getting rid of the %20 in your concat for your filter - I've never encoded spaces in a REST query before, perhaps try that...
    Hilary Stoupa

  • 06-01-2017 06:25 AM In reply to

    Re: REST API not querying result in InfoPath Web Form though it work fine in InfoPath Designer preview!!!

    Thanks for the insight Hilary, I have already disabled Loopback check, When I use data fields from secondary data source it works fine.
    On selection of Unit number I am firing REST filter to get Equipment Numbers on the basis of Unit numbers (from 40,000+ Equipment Numbers).
    I removed the %20 from the filter still same.

    Well till not I was using small sample list & not filtering from actual 40000 records but when I tried filtering from the actual list it did gave me this error: "XML data that is required for this form to function correctly cannot be found." looks like loopback issue, but at the same time if I use same REST filter on the list with less data; it neither gives error nor any query result, I have no clue why !!!!
    Shahid
  • 06-01-2017 07:51 AM In reply to

    Re: REST API not querying result in InfoPath Web Form though it work fine in InfoPath Designer preview!!!

    Maybe check your ULS logs - I wonder if the REST URL you are using would be displayed there & then you could try the same URL in the browser. Or put your same concat in a test field as the default value so you can put that on the form, copy out the URL & verify you get results in the browser?
    Hilary Stoupa

  • 06-04-2017 04:11 AM In reply to

    Re: REST API not querying result in InfoPath Web Form though it work fine in InfoPath Designer preview!!!

    I checked the ULS logs it looks like permission issue, as things are working as expected in the design preview!! . I could see following entries in ULS logs.

    Name=Request (POST:http://MyURL/_layouts/15/Postback.FormServer.aspx) Non-OAuth request. IsAuthenticated=True, UserIdentityName=0#.w|pcl\96085, ClaimsCount=55 Entering monitored scope (Request (GET:http://MyURL/_vti_bin/listdata.svc/Equipment_No?$filter=Unit eq 'UNIT15-EP1')).

    I pasted the REST from the logs in the browser it renders xml.

    Though I have disabled the loopback check do you think I am missing out on anything else?
    Shahid
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.