Data Providers
Microsoft OneDrive
Create a file
5min
You can create a file in OneDrive from a solution in the . Use the media-field component in a form to upload a file or image, then use the OneDrive Data Provider, its create method. and required properties for successful file creation.
Create a fle in OneDrive
The following properties are required in the YAML:
- file - reference the physical file
- fileName - add the file name with the extension, e.g. Invoice.pdf
- entity - file path in OneDrive
- tokenType - OAuth token credentials name
- method: create
To create a file use the media-field component to select the file. Use the image, or any property in the media-field component to specify the mediaType.
- A new file is created even when an id is specified.
- Using the method: save will create a new file if the filename does not exist, otherwise the save will function as an update method.
- A delay or time lag of several minutes could be experienced when files are syncing between the device and OneDrive.
The code below provides an example for creating an invoice in the myfiles directory of OneDrive.
Example of a modal message that can be displayed when creating a file with an existing file name. The full code snippet is shown:
Updated 23 Nov 2023
Did this page help you?