简体   繁体   中英

SharePoint 2013 - InfoPath form using REST API and cannot get the data

Environment: SharePoint 2013 Online & InfoPath form 2013

I'm try to make a data collection using REST API and using a button to trigger the action.

When I preview the form & press the button first time, I get the error as below

The query cannot be run for the following DataObject: Document in Dev InfoPath cannot run the specified query.
The file is not a valid XML file.
Some form data cannot be retrieved bacause InfoPath is operating offline mode. Form elements, such as drop-down lists, may be blank. Ensure that you have network connectivity and that InfoPath is online mode.


When I Click the button second time , it can be receive the data.

When I publish the form to SharePoint, I will get the error every time when i press the button

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


Any Idea??
I can get the correct data when I directly access the REST API link.

下载文件时必须添加?NoRedirect=true

file.xml?NoRedirect=true

Same error (400 bad request) cost me much time. My working solution is adding NoRedirect=true at the end of my URL:

http://server/qa/_vti_bin/owssvr.dll?Cmd=Display&List={***E885}&XMLDATA=TRUE&noredirect=true

Ref: https://sajiviswam.wordpress.com/2012/03/20/the-form-cannot-run-the-specified-query-in-infopath-2007-forms-migrated-to-sharepoint-2010/#comment-564

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM