cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Re: PowerApps:Updating a entry in sharepoint list

Hi ,I need bit of help regarding offline mode using sharepoint , I have tried everything but the local cached data is not getting updated in sharepoint when the app is getting reconnected to internet , though it doesn't shows any errors. Offline data not getting updated in sharepoint. Below is my code, Pointer : When user is offline and trying to make a new entry his record is being saved in Collection "LocalUpdatedRecords" and when he regains the internet connectivity the records should be updated in sharepoint list "Offline test" .I have tried Using Patch ,Update ,Collect etc but nothing seems to update the records in sharepoint, any suggestions will be highly appreciated. Thanks in advance. If(Connection.Connected && CountRows(LocalUpdatedRecords)>0, ForAll(LocalUpdatedRecords,Patch(OfflineTest,Defaults(OfflineTest),{FirstName :lbl_FirstName,LastName:lbl_LastName,Age:lbl_Age,Mobile:lbl_Mobile})); Clear(LocalUpdatedRecords); SaveData(LocalUpdatedRecords,"LocalUpdatedRecordsToBeAdded"); Refresh(OfflineTest); ClearCollect(OfflineData2,OfflineTest); SaveData(OfflineData2,"LocalCachedData")); Navigate(BrowseScreen1,ScreenTransition.Cover)

JD2301
Level: Powered On

Re: PowerApps:Updating a entry in sharepoint list

Hi Menehgino

 

I am trying to do something similar.
Is it possible to have in my patch statement a formula that will automatically know which ID in my SP list to update?
If a task in my app is 'Failed', an email notification with a link to a screen in the app sends out the the person assigned to fix this. 
The link opens a page in the app which has a comments box to enter the actions taken. Once the comments are added, then the 'Comments' field in my SP list for that record which was previously empty is updated.

At the moment I cant figure out how to automate this. I am having to manually enter the SP ID into my Patch statement which will not work once I publish this app for others to use as they wont know the SP ID.

 

Thanks.

Playman2006
Level: Powered On

Re: PowerApps:Updating a entry in sharepoint list

I was able to FINALLY set up this function to update a sharepoint list, but it changes the ID on the list. I am using this for a ticketing system and need the ID' to stay the same. How can i update a SP list without the ID changing. 

Patch(NCRLists,{ ID: SelectedItem.ID }, {
        Title: "",      
        FormID: [@FormID].Text,
        RequestedBy: RequestedBy_up.Text,
        Site: SiteOption_Form1_up.SelectedText.Value,
        Priority: PriorityOption_Form1_up.SelectedText.Value,
        Client: ClientOption_Form1_up.SelectedText.Value,
        Subject: SubjectOption_Form1_up.SelectedText.Value,
        Product_nonConf: Product_nonConf_item_up.SelectedText.Value,
        Process_nonConf: Process_nonConf_item_up.SelectedText.Value,
        Other_item: Other_item_up.Text,
        Description: Description_Form1_up.Text,
        Immediate_Action: ImmediateAction_Form1_up.Text,
        Fines_Penalties: FinesPenalties_cost_up.Text,
        Product_Replacement: ProductReplacement_Cost_up.Text,
        Shipping_Cost: Shipping_Cost_up.Text,
        Research_Cost: Research_Cost_up.Text,
        Labor: Labor_Cost_up.Text
       
    })

These are the fields i re populate because the user has the ability to change ANY field in this part. If there is a way to minimize this to ONLY the option that is different please let me know. BUT please how do i NOT change the ID # when this is ran on the list?