Rest call in infopath 2013 An error occurred querying a data source. - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Rest call in infopath 2013 An error occurred querying a data source.

Last post 10-20-2021 05:45 AM by sb_infodev. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 10-13-2021 12:40 AM

    Rest call in infopath 2013 An error occurred querying a data source.

    Hi All, I have a sharepoint list with around 2000 records( lets say list A), I have to check whether the data entered in the new item for LIST A already exists in the same list (List A). the normal data connection to the list takes a lot of time to load. So I wrote a simple REST call just to get the specific item. https://(Site name here )/_api/web/lists/GetByTitle('LISTA')/Items?$select=ID&$filter=hidden_bAi eq '02-12' This query works in the browser, even in the infopath form I am modifying this rest call to update the query and the querying it . I am also printing it in a variable tp check if the REST call is correct and it is, it works in browser. But when I publish the fomr, it doesnt work. An error occurred querying a data source. Can someone please help me. Thanks.
  • 10-14-2021 07:39 AM In reply to

    Re: Rest call in infopath 2013 An error occurred querying a data source.

    Is this SharePoint online or on-prem? If online, the REST query will probably not work. If on-prem, you should have your SharePoint admin take a look at the logs to determine the issue. However, since this is a simple equivalence query you would not need to use REST at all. Add a list data connection to your list, but on the final dialog, deselect the checkbox to query for data on form open. Then, in your form, at the same point you were executing your REST query, set the list query field to the value you need, and then run the list query. The list query will only return data that matches on the query field.
    Hilary Stoupa

  • 10-15-2021 04:14 AM In reply to

    Re: Rest call in infopath 2013 An error occurred querying a data source.

    Hi Hilary, thanks for your response. But setting the query field doesn't work. I even tried a simple field like ID, but even that did not work. Step 1) set the field -? field ID = 114 ( query field of the secondary source) Step2) Query data connection step 3) set a field with the data field of that connection. The field is empty. Please help and let me know if I am doing something wrong.
  • 10-15-2021 08:00 AM In reply to

    Re: Rest call in infopath 2013 An error occurred querying a data source.

    It is hard to guess without looking at your form, but usually what I do is drag the whole list data connection onto the form (query and data fields) and add a button that just runs the query. Then I can test the form in preview or in the browser. Set a query field, run the query, verify that there are data rows returned. From there, you may be able to figure out why your field is blank.
    Hilary Stoupa

  • 10-20-2021 05:45 AM In reply to

    Re: Rest call in infopath 2013 An error occurred querying a data source.

    Hi Hilary, Thanks for your response. I tried it this way and it worked. Thanks Snehal
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.