Reputation: 13
We built a Canvas App that is connected to a SharePoint list. Forms within the app update various data columns in the list. Everything has been working up until yesterday. When we attempt to save data on the form using the SubmitForm function, data in text fields won't save properly. For example, if I modify three different text fields on the form and click save, only the first two changes will save. If I modify 5 text fields, and click save, the first 4 changes will save but not the last. I've isolated the issue to text fields specifically, and whatever the last change is, does not save.
This has not been an issue in the past.
Testing the different form fields and determined the issue is isolated to text fields. Reviewed the update field and its coded properly. SubmitForm functions are also coded properly.
Save button OnSelect property: SubmitForm(Form); UpdateContext({ editmode: false, selectedRecord: CurrentItem )}
Update Property of textfields: DataCardValue#.Value
Upvotes: 1
Views: 1555
Reputation: 11
I'm having the same problem in my canvas app...I just figured out why this happens and the reason is that you first need to lose the focus from the last edited field, that way the Value will change (for example clicking out of the field).
If anyone has a solution for this please share it! I tried creating an invisible button that is selected once the Save button is clicked, and then sending the form but, isn't working either.
SaveBtn.OnSelect:
Select(invisibleBtn);;
SubmitForm(form)
---- 1st Edit ----
Ok as Jono Jack said, if you set the option "Trigger output" of a TextField to "Key Press", the problem solves.
Upvotes: 1
Reputation: 118
For all the fields relevant, make sure you set the option for each field like the text field to have the Trigger output field set to "Keypress" instead of the default "Focus Out". This forces it to update prior to submission.
Upvotes: 1
Reputation: 13
After going back and forth with tech support for a couple of days the issue resolved itself. Discovered the same problem in another app soon after posting the original question here. The best thing Microsoft could come up with was there was an update to SharePoint that caused the issue and a follow-up update fixed the error.
Upvotes: 0