Data Providers
Microsoft OneDrive
Delete a file
4min
you can delete existing files in onedrive from a solution in the {{jigxapp}} this can be used to remove incorrect files or files that are no longer required first, you must return the files available in onedrive, for example, in a list, select the file to be deleted by configuring a button or swipeable element, then use the onedrive data provider, its delete method, and required properties properties the following properties are required in the yaml entity file path in onedrive id reference the physical file by its id tokentype oauth token credentials name method delete considerations the path entity is not used in the deletion process files are deleted in all folders as expected, even when the incorrect folder is specified as the delete method uses id a delay or time lag of several minutes could be experienced when files are syncing between the device and onedrive code example the code example below provides an example of a list of invoices in the myfiles directory of onedrive when swiping left and pressing the delete button deletes the file on onedrive deleting file jigx title delete invoice description delete a specific invoice type jig list header type component jig header options height medium children type component image options source uri https //builder jigx com/assets/images/header jpg onfocus type action sync entities options \# reference the onedrive provider to sync the folder meta data to the local data provider provider data provider onedrive entities \ entity myfiles data tokentype jigx graph oauth datasources file data myfiles type datasource sqlite options \# store the files metadata from onedrive using local data provider provider data provider local \# reference the path on onedrive where the files are located entities \ myfiles \# use the name and id to return in the list query select id, '$ name' as name from \[myfiles] order by '$ name' desc data =@ctx datasources file data myfiles item type component list item instanceid =@ctx current item id options title =@ctx current item name swipeable left \ label delete color negative onpress type action confirm options isconfirmedautomatically false onconfirmed type action execute entity options \# reference the onedrive data provider provider data provider onedrive entity myfiles method delete data tokentype jigx graph oauth id =@ctx current item id onsuccess title file deleted \# confirm that file must be deleted using a modal modal title are you sure you want to delete this file? see also microsoft onedrive docid\ ew xr957mdvqj5085ry1q create a file docid\ vofrdg22dnh6iogv6uo1k update/save a file docid\ jhblr6stmrc2q8z7sn95w list files docid\ qxboqt6gy 4egcj tvqps download a file docid\ aqij2xesfvank84spy4yg