Hello,
I currently have an app that is used to complete forms offline. I am able to store my forms to a collection when offline, but am having trouble sending it to the data source after and clearing the collection. The locally stored forms are located in a gallery and transition to a submitted gallery once pushed to SP.
I use a button to try to push the locally stored data to SP. I shared my code i used to store the collection and the code on my button to push the forms to SP
Let me know if you need any more information
Thanks
What error messages are you getting? Viewing your code I see lots of red, and if the second button (shorter set of code one) is what you are pushing to try and send stuff TO sharepoint I don't see any code in there that would accomplish that.
I attached some images of the errors ive been getting. I thought the basis for my code to push data to SP was right. If not do you possibly guide me to fixing it?
thanks
sam
Yeah I have been the code and watching videos i have found to add offline functionality and had a different idea on what the load actually did. I attached my patch function below, the OnSelect for the button that will patch the selected form to SP. I dont know how I would go about using it if I have like 5 forms saved locally and want to send them all to SP.
I want to be able to have a sync button that will patch all the forms in a collection to SP. I also have headers without data card values that have an update function in them to collect averages as you can see at the end. I reference a label to each of them to properly store that data. Will a patch be able to send mulitiple forms in a collection at once?
Thank you for the clarification and let me know if I am not clear enough on what I am trying to do and if you need any more details
So anyways theres a couple different ways to handle adding items to a sharepoint list. FIRST the list has to be premade, and you have to use the column names assigned in the list. (Best way to be sure of them is goto list settings (top right gear) then click on each column one at a time, the column reference name will be last part of the web address in the bar above your browser.) I always double check them because sometimes sharepoint inexplicably changes the reference name from what you had set it as. So just to be safe.
Couple different ways to add items to the list.
This one will add a new item to the sharepoint list UBOBoard, THIS METHOD WILL ONLY WORK IF YOUR SHAREPOINT LIST IS NOT EMPTY. On an empty SP List it will throw up an annoying message. I rarely use it because of that.
Collect(UBOBoard, {Title: ThisItem.Title, DATE: DateTimeValue(Label21_2.Text), CURRENTLOCATION:"Upper Lot", HOURSSCHED:Value(shifthrs_2.Text), LOANERINVENUE:false})
This is the most common code I use to add a new row to SP List. This one adds an item to my SPList UBOBoard
Patch(UBOBoard, {Title: ThisItem.Title, DATE: DateTimeValue(Label21.Text), CURRENTLOCATION:"Upper Lot", HOURSSCHED:Value(shifthrs.Text), LOANERINVENUE:false})
This one updates a record in the SPList UBOBoard
Patch(UBOBoard, {ID:ThisItem.ID},{DAYSUMMARY:prevassignment & " - " & RoundDown(DateDiff(ThisItem.ASSIGNMENTTIME,DateTimeValue(officialass_1.Text),Minutes),0)&" minutes",ASSIGNMENTTIME:DateTimeValue(officialass_1.Text),CURRENTASSIGNMENT:Text(Radio1_1.Selected.Value)})
Another way to do multiple records at once would be to clearcollect a temporary collection, then add other forms to it via collect
IE)
ClearCollect(TempData, ***ALLTHESTUFFYOUWANT ON THIS COLLECTION);
collect(tempdata,****nextcollectiontoadd);
collect(tempdata,****nextcollectiontoadd)
ETC.
then patch your sharepoint list with this collection, or if its not an empty sp list, collect it.
User | Count |
---|---|
135 | |
132 | |
79 | |
75 | |
71 |
User | Count |
---|---|
210 | |
197 | |
69 | |
62 | |
53 |