OneDrive Connector for Informatica
In this article you will learn how to integrate Using OneDrive Connector you will be able to connect, read, and write data from within Informatica. Follow the steps below to see how we would accomplish that. The driver mentioned above is part of ODBC PowerPack which is a collection of high-performance Drivers for various API data source (i.e. REST API, JSON, XML, CSV, Amazon S3 and many more). Using familiar SQL query language you can make live connections and read/write data from API sources or JSON / XML / CSV Files inside SQL Server (T-SQL) or your favorite Reporting (i.e. Power BI, Tableau, Qlik, SSRS, MicroStrategy, Excel, MS Access), ETL Tools (i.e. Informatica, Talend, Pentaho, SSIS). You can also call our drivers from programming languages such as JAVA, C#, Python, PowerShell etc. If you are new to ODBC and ZappySys ODBC PowerPack then check the following links to get started. |
Connect to OneDrive in other apps
|
How to read API data in Informatica (Call JSON / XML SOAP Service)
How to write data to API (POST) in Informatica (Call JSON / XML SOAP Service)
Introduction
JSON / REST API is becoming more and more popular each day as everyone embrace cloud-centric services. This article is primarily focused on Informatica users who want to access OneDrive data or may be other API Integration in Informatica. However many tips and techniques described in this article will help you to understand how to integrate OneDrive / XML SOAP / JSON / REST API in other ETL / Reporting apps such as Tableau, Power BI, SSRS, Talend, Excel and many more.
After going through this article you will learn how to Read OneDrive / JSON / REST API data in Informatica and understand the concept of JSON / REST API. We will go through many screenshots and step-by-step examples to demonstrate OneDrive or REST API integration in Informatica PowerCenter.
XML / JSON can come from a local file or REST API service (internal or public) so we will include both examples in this article (i.e. Read JSON files in Informatica, Import REST API in Informatica). So let’s get started. Next article will focus on how to write data to API in Informatica (POST / PUT data)
Requirements
This article assumes that you have full filled following basic requirements.
- Download Install ZappySys ODBC PowerPack (API Driver for OneDrive included)
- Install Informatica PowerCenter Client Tools (e.g. Workflow and Mapping Designers)
- Access to a Relational database such as SQL Server (or use any of your choice e.g. Oracle, MySQL, DB2 ). If nothing available then you can use flat file target.
High level Steps for Import OneDrive data using Informatica (Read OneDrive API data)
Before we dive deep to learn how to load OneDrive data in Informatica (i.e. OneDrive to SQL Table), Here the summary of high-level steps you need to perform to import OneDrive in Informatica (same steps for Import JSON / XML / REST API).
- Download and Install ZappySys API Driver (for connecting to OneDrive)
- Create ODBC DSN using ZappySys API driver and choose OneDrive Connector during Wizard
- Create Relational > ODBC Connection in Informatica Workflow designer (Point to DSN we created in the previous step)
- Import OneDrive Source Definition in the Informatica Mapping Designer > Sources Tab
- Import Target Table Definition in the Informatica Mapping Designer > Targets Tab
- Create source to target mapping in Mappings tab
- Save mapping (name m_API_to_SQL_Load )
- Create Session using the mapping we created in the previous step
- Save Workflow and execute to load OneDrive data into SQL Table. Verify your data and log.
Video Tutorial – Read any API / JSON data in Informatica (Load OneDrive to SQL Table)
Below video is not about OneDrive API but its showing API access in general (for any API). By watching following ~5 min video can learn steps listed in this article to load JSON API data into SQL Server Table using ZappySys JSON Driver. You can go though full article to learn many useful details not covered in this video.
Getting Started – Import OneDrive to SQL Server in Informatica
Now let’s get started. For example purpose, we will read data from OneDrive and load data into SQL Server Table using Informatica Workflow.
Create ODBC Data Source (DSN) based on ZappySys API Driver
Step-by-step instructions
To get data from OneDrive using Informatica we first need to create a DSN (Data Source) which will access data from OneDrive. We will later be able to read data using Informatica. Perform these steps:
-
Install ZappySys ODBC PowerPack.
-
Open ODBC Data Sources (x64):
-
Create a User Data Source (User DSN) based on ZappySys API Driver
ZappySys API DriverYou should create a System DSN (instead of a User DSN) if the client application is launched under a Windows System Account, e.g. as a Windows Service. If the client application is 32-bit (x86) running with a System DSN, use ODBC Data Sources (32-bit) instead of the 64-bit version. -
When the Configuration window appears give your data source a name if you haven't done that already, then select "OneDrive" from the list of Popular Connectors. If "OneDrive" is not present in the list, then click "Search Online" and download it. Then set the path to the location where you downloaded it. Finally, click Continue >> to proceed with configuring the DSN:
OnedriveDSNOneDrive -
Now it's time to configure the Connection Manager. Select Authentication Type, e.g. Token Authentication. Then select API Base URL (in most cases, the default one is the right one). More info is available in the Authentication section.
Use delegated access (User Credentials) whenever you want to let a signed-in user work with their own resources or resources they can access. Whether it's an admin setting up policies for their entire organization or a user deleting an email in their inbox, all scenarios involving user actions should use delegated access. [API reference]
Steps how to get and use OneDrive credentials
Follow these simple steps below to create Microsoft Entra ID application with delegated access:
WARNING: To automate your company's processes, make sure you use a system/generic account (e.g.automation@my-company.com
). When you use a personal account which is tied to a specific employee profile and that employee leaves the company, the token may become invalid and any automated processes using that token will start to fail.- Navigate to the Azure Portal and log in using your credentials.
- Access Microsoft Entra ID.
-
Register a new application by going to
App registrations
and clicking on New registration button:
INFO: Find more information on how to register an application in Graph API reference.
-
When configuration window opens, configure these fields:
-
Supported account type
- Use
Accounts in this organizational directory only
, if you need access to data in your organization only.
- Use
-
Supported account type
-
Redirect URI:
- Set the type to
Public client/native (mobile & desktop)
. - Use
https://zappysys.com/oauth
as the URL.
- Set the type to
-
After registering the app, copy the Application (client) ID for later:
-
Then copy OAuth authorization endpoint (v2) & OAuth token endpoint (v2) URLs to use later in the configuration:
-
Now go to SSIS package or ODBC data source and use the copied values in User Credentials authentication configuration:
- In the Authorization URL field paste the OAuth authorization endpoint (v2) URL value you copied in the previous step.
- In the Token URL field paste the OAuth token endpoint (v2) URL value you copied in the previous step.
- In the Client ID field paste the Application (client) ID value you copied in the previous step.
-
In the Scope field use the default value or select individual scopes, e.g.:
-
email
-
offline_access
-
openid
-
profile
-
User.Read
-
Files.Read.All
-
Files.ReadWrite.All
-
- Press Generate Token button to generate Access and Refresh Tokens.
- Optional step. Choose Default Site Id from the drop down menu.
- Click Test Connection to confirm the connection is working.
- Done! Now you are ready to use the API Connector!
Fill in all required parameters and set optional parameters if needed:
OnedriveDSNOneDriveUser Credentials [OAuth]https://graph.microsoft.com/v1.0Required Parameters Authorization URL Fill-in the parameter... Token URL Fill-in the parameter... Client ID Fill-in the parameter... Scope Fill-in the parameter... Optional Parameters Client Secret Refresh Token File Path Return URL https://zappysys.com/oauth Default Group or User Id (additional Scopes needed to list - If fails enter manually) Default Drive Id (Select after clicking **Generate Token**) me RetryMode RetryWhenStatusCodeMatch RetryStatusCodeList 429|503|423 RetryCountMax 5 RetryMultiplyWaitTime True Login Prompt Option Search Option For Non-Indexed Fields (Default=Blank - Search Only Indexed) Extra Headers (e.g. Header1:AAA||Header2:BBB) IsAppCred 0 Application-only access is broader and more powerful than delegated access (User Credentials), so you should only use app-only access where needed. Use it when: 1. The application needs to run in an automated way, without user input (for example, a daily script that checks emails from certain contacts and sends automated responses). 2. The application needs to access resources belonging to multiple different users (for example, a backup or data loss prevention app might need to retrieve messages from many different chat channels, each with different participants). 3. You find yourself tempted to store credentials locally and allow the app to sign in 'as' the user or admin. [API reference]
Steps how to get and use OneDrive credentials
Follow these simple steps below to create Microsoft Entra ID application with application access permissions. Using following steps, you can grant very granular app permissions to access Full site(s), List(s), List Item(s) and File(s). Choose permission based on your need.
Create OAuth app
- Navigate to the Azure Portal and log in using your credentials.
- Access Microsoft Entra ID.
-
Register a new application by going to
App registrations
and clicking on New registration button:
INFO: Find more information on how to register an application in Graph API reference.
-
When configuration window opens, configure these fields:
-
Supported account type
- e.g. select
Accounts in this organizational directory only
if you need access to data in your organization only.
- e.g. select
-
Supported account type
-
Redirect URI:
- Set the type to
Public client/native (mobile & desktop)
. - Leave the URL field empty.
- Set the type to
-
After registering the app, copy the Application (client) ID for later:
-
Then copy OAuth authorization endpoint (v2) & OAuth token endpoint (v2) URLs:
-
Continue and create Client secret:
-
Then copy the Client secret for later steps:
-
Continue by adding permissions for the app by going to the API permissions section, and clicking on Add a permission:
-
Select Microsoft Graph:
-
Then choose Application permissions option:
-
Continue by adding these Files (OneDrive) permissions (Just search for "Site" and then select desired permissions):
-
Move on by addding these Sites (SharePoint) permissions (You can search for "Site" and then select desired permissions):
-
Finish by clicking Add permissions button:
-
Now it's time to Grant admin consent for your application:
-
Confirm all the permissions are granted:
-
Now go to SSIS package or ODBC data source and use the copied values in Application Credentials authentication configuration:
- In the Token URL field paste the OAuth token endpoint (v2) URL value you copied in the previous step.
- In the Client ID field paste the Application (client) ID value you copied in the previous step.
- In the Client Secret field paste the Client secret value you copied in the previous step.
- Optional step. Choose Default Site Id from the drop down menu.
- Click Test Connection to confirm the connection is working.
- Done! Let's move on to the next step.
Step-2 (Method#1 - New Approach): Grant permission to app using permission API (UI is not available yet)
In year 2024 microsoft launched
*.Selected
permission scopes and new APIs to grant granular permissions to the resource for app access scenario. Unfortunatly, there is no User interface available yet to control this access so you have to call Admin API or use PowerShell script to control this. [Click here to learn more]. Follow these simple steps to configure permissions for app we created earlier (steps assume you are the owner of the resource and like to grant some permissions e.g. read, write, full, owner):- Open PowerShell (Run as Admin user)
- Install Graph API module by running this command
Import-Module Microsoft.Graph.Sites
- Now you can call following PowerShell code to set "read" and "write" permission for the app we created earlier (assuming app id is 89ea5c94-7736-4e25-95ad-3fa95f62b66e).
#More info https://learn.microsoft.com/en-us/graph/permissions-selected-overview?tabs=powershell #Step-1: Install module if not found #Install-Module Microsoft.Graph.Sites #Step-2: set permission for app 89xxx6e and site zappysys.xx.efcdd21xxxxe2 Import-Module Microsoft.Graph.Sites #Step-3: Login Connect-MgGraph #Step-4: Set Parameters for API Call (set Permissions, SiteId and AppId - Replace under #TODO) You can find SiteId by visiting this URL in browser (assuming you visted SharePoint site and already logged in) https://{your-company}.sharepoint.com/_api/site --OR-- for sub-site use https://{your-company}.sharepoint.com/sites/{your-site}/_api/site. Find Id from the response (e.g. <Id m:type="Edm.Guid">) $siteId="yourcompany.sharepoint.com,efcddxxxxxxx104d8b5e3,8c9c6xxxxxxxx84e2" #--OR-- simple id #$siteId="efcddxxxxxxx104d8b5e3" $params = @{ roles = @( #possible options are read, write, fullcontrol, owner (write includes read too) #TODO: Change here "write" ) grantedTo = @{ application = @{ #find this Client Id (Application Id) from the Azure Portal - Application page (https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade) #TODO: Change here id = "c3e9xxxxxx-xxxxx-xxxxx-xxxx-xxxxxb30c1" } } } #Step-5: Grant Permission New-MgSitePermission -SiteId $siteId -BodyParameter $params
Fill in all required parameters and set optional parameters if needed:
OnedriveDSNOneDriveApplication Credentials [OAuth]https://graph.microsoft.com/v1.0Required Parameters Token URL Fill-in the parameter... Client ID Fill-in the parameter... Client Secret Fill-in the parameter... Default Group or User Id (additional Scopes needed to list - If fails enter manually) Fill-in the parameter... Default Drive Id Fill-in the parameter... Optional Parameters Scope https://graph.microsoft.com/.default RetryMode RetryWhenStatusCodeMatch RetryStatusCodeList 429|503|423 RetryCountMax 5 RetryMultiplyWaitTime True Search Option For Non-Indexed Fields (Default=Blank - Search Only Indexed) Extra Headers (e.g. Header1:AAA||Header2:BBB) IsAppCred 1 -
Once the data source has been configured, you can preview data. Select the Preview tab and use settings similar to the following to preview data:
-
Click OK to finish creating the data source.
Video instructions
Create Connection in Informatica Workflow Designer
Once you create DSN using API Driver our next step is to define a connection for OneDrive source in Informatica PowerCenter Workflow designer.
- Open Workflow designer [W] icon
- Goto Connections > Relational
- Click New and select ODBC
- Now on the ODBC connection setup enter connection name, some fake userid / password (this is a required field but its ignored by JSON Driver)
-
In the Connection String field enter the exact same name of DSN (Open ODBC Data Sources UI to confirm)
Configure OneDrive connection in Informatica for REST API – Using ZappySys API Driver
- Click OK to close the connection properties.
That’s it. Now we ready to move to next step (define source and target in Mapping Designer).
Import OneDrive Source Definition in Informatica Mapping Designer
Now let’s look at steps to import OneDrive table definition.
- Open Informatica Mapping Designer (Click [D] icon)
- Click on Source Icon to switch to Sources designer
- From the top menu > Click on Sources > Import from Database …
- Select ODBC data source from the dropdown (Find out DSN we created earlier to use as JSON Source)
-
Click Connect button to get a list of tables. Any array node is listed as a table. Also, you will see array node with parent columns (e.g. value_with_parent). You may get some warning like below but they are harmless so just ignore by clicking OK.
DLL name entry missing from C:\Informatica\PowerCenter8.6.1\client\bin\powrmart.ini Section = ODBCDLL Entry = ZappySys JSON Driver
—————————————————-
Using EXTODBC.DLL to support ZappySys JSON Driver. For native support of ZappySys JSON Driver make an entry in the .ini file. - Select Table you wish to get (You can filter rows by custom SQL query. We will see later in this article how to do)
- Optionally once table structure is imported you can rename it
- That’s it, we are now ready to perform similar steps to import Target table structure in the next section.
Import SQL Server Target Definition in Informatica Mapping Designer
Now let’s look at steps to import Target table definition (very similar to the previous section, the only difference is this time we will select DSN which points to SQL Server or any other Target Server).
Now lets look at steps to import target table definition in Informatica mapping designer.
- In the Mapping Designer, Click on Target Icon to switch to Target designer
- From the top menu > Click on Targets > Import from Database …
- Select DSN for your Target server (if DSN doesn’t exist then create one by opening ODBC Sources just like we created one for JSON API source (see the previous section about creating DSN).
- Enter your userid , password and Schema name and click Connect to see tables
- Select Table name to and click OK import definition.
Create Source to Target Mapping in Informatica (Import JSON to SQL Server)
Once you have imported source and target table definition, we can create mapping and transformation to load data from JSON to SQL Table.
- First open Mapping Designer (Click [D] icon)
- Drag JSON Source from sources folder
- Drag SQL Table from Targets folder
- Map desired columns from Source to target
-
For certain columns you may have to do datatype conversion. For example to convert OrderDate form nstring to DataTime you have to use Expression Transform like below and map it to target. In below example, our JSON has date format (e.g. 2018-01-31 12:00:00 AM ). To import this to DateTime field in SQL server we need to convert it using TO_DATE function. Use double quotes around T to make this format working.
TO_DATE(OrderDate,'YYYY-MM-DD H12:MI:SS AM') --For ISO use below way TO_DATE(OrderDate,'YYYY-MM-DD"T"HH24:MI:SS')
- Once you done with mapping save your mapping and name it (i.e. m_Api_To_SQL)
- Now lets move to next section to create workflow.
Create Workflow and Session in Informatica
Now the final step is to create a new workflow. Perform following steps to create workflow which with a session task to import JSON data into SQL table.
- Open workflow designer by click [W] icon.
-
Launch new workflow creation wizard by click Workflow top menu > Wizard
name your workflow (e.g. wf_Api_Tp_Sql_Table_Import) - Finish the wizard and double-click the Session to edit some default properties.
- First change Error settings so we fail session on error (By default its always green)
- Select JSON connection for Source
- Change default Source query if needed. You can pass parameters to this query to make it dynamic.
- Select Target connection of SQL Target Table
- Save workflow
- That’s it. We ready to run our first workflow to load JSON data to SQL.
Execute Workflow and Validate Log in Informatica
Now once you are done with your workflow, execute it to see the log.
POST data to OneDrive in Informatica
There will be a time when you like to send Source data to REST API or SOAP Web Service. You can use below Query for example. For detailed explanation on how to POST data in Informatica check this article.
Video Tutorial – How to POST data to REST API in Informatica
Here is detailed step by step video on REST API POST in informatica PowerCenter
Keywords
how to import OneDrive in informatica | how to read OneDrive data in informatica powercenter | how to test json from informatica | how to use OneDrive data as source in informatica power center | how to connect OneDrive in informatica 10 | informatica how to import data from OneDrive | informatica jtx to import OneDrive (use of java transformation) | informatica plugin for restful api using json | informatica power center and OneDrive support | informatica read OneDrive | informatica rest api | informatica OneDrive connector | json parser import informatica
Advanced topics
Create Custom Stored Procedure in ZappySys Driver
You can create procedures to encapsulate custom logic and then only pass handful parameters rather than long SQL to execute your API call.
Steps to create Custom Stored Procedure in ZappySys Driver. You can insert Placeholders anywhere inside Procedure Body. Read more about placeholders here
-
Go to Custom Objects Tab and Click on Add button and Select Add Procedure:
-
Enter the desired Procedure name and click on OK:
-
Select the created Stored Procedure and write the your desired stored procedure and Save it and it will create the custom stored procedure in the ZappySys Driver:
Here is an example stored procedure for ZappySys Driver. You can insert Placeholders anywhere inside Procedure Body. Read more about placeholders here
CREATE PROCEDURE [usp_get_orders] @fromdate = '<<yyyy-MM-dd,FUN_TODAY>>' AS SELECT * FROM Orders where OrderDate >= '<@fromdate>';
-
That's it now go to Preview Tab and Execute your Stored Procedure using Exec Command. In this example it will extract the orders from the date 1996-01-01:
Exec usp_get_orders '1996-01-01';
-
Let's generate the SQL Server Query Code to make the API call using stored procedure. Go to Code Generator Tab, select language as SQL Server and click on Generate button the generate the code.
As we already created the linked server for this Data Source, in that you just need to copy the Select Query and need to use the linked server name which we have apply on the place of [MY_API_SERVICE] placeholder.
SELECT * FROM OPENQUERY([MY_API_SERVICE], 'EXEC usp_get_orders @fromdate=''1996-07-30''')
-
Now go to SQL served and execute that query and it will make the API call using stored procedure and provide you the response.
Create Custom Virtual Table in ZappySys Driver
ZappySys API Drivers support flexible Query language so you can override Default Properties you configured on Data Source such as URL, Body. This way you don't have to create multiple Data Sources if you like to read data from multiple EndPoints. However not every application support supplying custom SQL to driver so you can only select Table from list returned from driver.
If you're dealing with Microsoft Access and need to import data from an SQL query, it's important to note that Access doesn't allow direct import of SQL queries. Instead, you can create custom objects (Virtual Tables) to handle the import process.
Many applications like MS Access, Informatica Designer wont give you option to specify custom SQL when you import Objects. In such case Virtual Table is very useful. You can create many Virtual Tables on the same Data Source (e.g. If you have 50 URLs with slight variations you can create virtual tables with just URL as Parameter setting.
-
Go to Custom Objects Tab and Click on Add button and Select Add Table:
-
Enter the desired Table name and click on OK:
-
And it will open the New Query Window Click on Cancel to close that window and go to Custom Objects Tab.
-
Select the created table, Select Text Type AS SQL and write the your desired SQL Query and Save it and it will create the custom table in the ZappySys Driver:
Here is an example SQL query for ZappySys Driver. You can insert Placeholders also. Read more about placeholders here
SELECT "ShipCountry", "OrderID", "CustomerID", "EmployeeID", "OrderDate", "RequiredDate", "ShippedDate", "ShipVia", "Freight", "ShipName", "ShipAddress", "ShipCity", "ShipRegion", "ShipPostalCode" FROM "Orders" Where "ShipCountry"='USA'
-
That's it now go to Preview Tab and Execute your custom virtual table query. In this example it will extract the orders for the USA Shipping Country only:
SELECT * FROM "vt__usa_orders_only"
-
Let's generate the SQL Server Query Code to make the API call using stored procedure. Go to Code Generator Tab, select language as SQL Server and click on Generate button the generate the code.
As we already created the linked server for this Data Source, in that you just need to copy the Select Query and need to use the linked server name which we have apply on the place of [MY_API_SERVICE] placeholder.
SELECT * FROM OPENQUERY([MY_API_SERVICE], 'EXEC [usp_get_orders] ''1996-01-01''')
-
Now go to SQL served and execute that query and it will make the API call using stored procedure and provide you the response.
Actions supported by OneDrive Connector
OneDrive Connector support following actions for REST API integration. If some actions are not listed below then you can easily edit Connector file and enhance out of the box functionality.Parameter | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
Default Group or User Id (additional Scopes needed to list - If fails enter manually) |
|
Parameter | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
Default Group or User Id (additional Scopes needed to list - If fails enter manually) |
|
||||||||
Drive Id / Shared Folder |
|
Parameter | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
Default Group or User Id (additional Scopes needed to list - If fails enter manually) |
|
||||||||
Drive Id / Shared Folder |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Default Group or User Id (additional Scopes needed to list - If fails enter manually) |
|
||||||||||||||
Drive Id / Shared Folder |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
Folder Id or Path (e.g. root: -OR- root:/myfolder: ) - Max 200 items listed |
|
Parameter | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Default Group or User Id (additional Scopes needed to list - If fails enter manually) |
|
||||||||||||||||||
Drive Id / Shared Folder |
|
||||||||||||||||||
Search Type (Default=Recursive) |
|
||||||||||||||||||
Search Path (Default=Root Folder) - Max 200 listed |
|
||||||||||||||||||
Order By Field(s) - Only for Recursive SearchType |
|
Parameter | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Default Group or User Id (additional Scopes needed to list - If fails enter manually) |
|
||||||||||||||||||
Drive Id / Shared Folder |
|
||||||||||||||||||
Search Type (Default=Recursive) |
|
||||||||||||||||||
Search Path (Default=Root Folder) |
|
||||||||||||||||||
Order By Field(s) - Only for Recursive SearchType |
|
Parameter | Description |
---|
Parameter | Description |
---|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Default Group or User Id (additional Scopes needed to list - If fails enter manually) |
|
||||||||||||||
Drive Id / Shared Folder |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
FileId -OR- Path |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Default Group or User Id (additional Scopes needed to list - If fails enter manually) |
|
||||||||||||||
Drive Id / Shared Folder |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
Excel File Id or Path (e.g. root:/somefolder/myfile.xlsx: ) - Max 200 Listed |
|
||||||||||||||
Sheet Id or Name (e.g. {00xx-xxx-xx123} -OR- Sheet1 ) |
|
||||||||||||||
AutoDetectByValue |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Drive Id / Shared Folder |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
Excel File Id or Path (e.g. root:/somefolder/myfile.xlsx: ) - Max 200 Listed |
|
||||||||||||||
Sheet Id or Name (e.g. {00xx-xxx-xx123} -OR- Sheet1 ) |
|
||||||||||||||
Range |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Default Group or User Id (additional Scopes needed to list - If fails enter manually) |
|
||||||||||||||
Drive Id / Shared Folder |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
File Id or Path (e.g. root:/somefolder/myfile.xyz: ) - Max 1000 Listed |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Default Group or User Id (additional Scopes needed to list - If fails enter manually) |
|
||||||||||||||
Drive Id / Shared Folder |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
File Id or Path (e.g. root:/somefolder/myfile.xyz: ) - Max 1000 Listed |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Default Group or User Id (additional Scopes needed to list - If fails enter manually) |
|
||||||||||||||
Drive Id / Shared Folder |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
File Id or Path (e.g. root:/somefolder/myfile.xyz: ) - Max 1000 Listed |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Default Group or User Id (additional Scopes needed to list - If fails enter manually) |
|
||||||||||||||
Drive Id / Shared Folder |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
File Id or Path (e.g. root:/somefolder/myfile.xyz: ) - Max 1000 Listed |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Default Group or User Id (additional Scopes needed to list - If fails enter manually) |
|
||||||||||||||
Drive Id / Shared Folder |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
File Id or Path (e.g. root:/somefolder/myfile.xyz: ) - Max 1000 Listed |
|
||||||||||||||
Convert to new format (e.g. pdf or html) |
|
Parameter | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Default Group or User Id (additional Scopes needed to list - If fails enter manually) |
|
||||||||||
Drive Id / Shared Folder |
|
||||||||||
Disk File Path (e.g. c:\somefolder\file.xlsx) |
|
||||||||||
Target File Path / Id (e.g. file.xlsx -OR- myfolder/file.xlsx -OR- 0Zxxxx1234) |
|
||||||||||
Conflict Behavior (What to do if file exists) |
|
||||||||||
Use Source File Created/Modified DateTime rather than Uploaded Time |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Default Group or User Id (additional Scopes needed to list - If fails enter manually) |
|
||||||||||||||
Drive Id / Shared Folder |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
File/Folder Id or Path (e.g. root:/myfolder: -OR- root:/myfolder/file.xyz: ) - Max 1000 Listed |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Default Group or User Id (additional Scopes needed to list - If fails enter manually) |
|
||||||||||||||
Drive Id / Shared Folder |
|
||||||||||||||
File/Folder Id or Path (e.g. root:/myfolder: -OR- root:/myfolder/file.xyz: ) - Max 1000 Listed |
|
||||||||||||||
Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Operation |
|
||||||||||||||
Default Group or User Id (additional Scopes needed to list - If fails enter manually) |
|
||||||||||||||
Source Drive Id |
|
||||||||||||||
Source File or Folder Id you like to move or rename |
|
||||||||||||||
Target Drive Id (Select if different than source DriveId) |
|
||||||||||||||
Target Folder Id (e.g. 01R65Qxxxxxxx123 -OR- root) - Max 200 items listed |
|
||||||||||||||
Target Item Name (Optional for Move - e.g. Myfile.pdf or MyFolder) |
|
||||||||||||||
Source Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Source Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
Target Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Target Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
Prefer Async Operation (Enable if you get error) |
|
Parameter | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Default Group or User Id (additional Scopes needed to list - If fails enter manually) |
|
||||||||||||||
Source Drive Id |
|
||||||||||||||
Source File or Folder Id you like to copy |
|
||||||||||||||
Target DriveId (Optional - Select if different than source DriveId) |
|
||||||||||||||
Target Folder Id (e.g. 01R65QTTRxxxxx -OR- root) |
|
||||||||||||||
Target Item Name (Optional) |
|
||||||||||||||
Source Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Source Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
Target Search Type (For UI Only - Default=Recursive - i.e. Blank) |
|
||||||||||||||
Target Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed |
|
||||||||||||||
Prefer Async Operation (Enable if you get error) |
|
||||||||||||||
Conflict Behavior (What to do if file exists at target location) |
|
Parameter | Description | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Url |
|
||||||||||||||||||||||||||
Body |
|
||||||||||||||||||||||||||
IsMultiPart |
|
||||||||||||||||||||||||||
Filter |
|
||||||||||||||||||||||||||
Headers |
|
Parameter | Description |
---|---|
Url |
|
IsMultiPart |
|
Filter |
|
Headers |
|
OneDrive Connector Examples for Informatica Connection
This page offers a collection of SQL examples designed for seamless integration with the ZappySys API ODBC Driver under ODBC Data Source (36/64) or ZappySys Data Gateway, enhancing your ability to connect and interact with Prebuilt Connectors effectively.
List All Files (Recursive) [Read more...]
Lists all files (recursive)
SELECT * FROM Files
List All Folders (Recursive) [Read more...]
Lists all folders recursively (exclude files)
SELECT * FROM Folders
List All Files and Folders (Recursive) [Read more...]
Lists all files and folders recursively
SELECT * FROM FilesFolders
List All Files and Folders Shared with Me [Read more...]
Lists all files / folders shared with me. To List shared file inside a specific folder use FilesFolders table (e.g. select * from FilesFolders WITh(DriverId='zzzzz', SearchPath='zzzz') ). Provide DriveId (Found in SharedWithMe Table - see remoteItem_parentReference_driveId column) and optionally supply SearchPath (e.g. /root:/folder/subfolder: ) from which you like to list files/folders.
SELECT * FROM SharedWithMe
List drives [Read more...]
Lists all drives
SELECT * FROM Drives
Get drive [Read more...]
Gets info about drive
SELECT * FROM get_drive
WITH (DriveId='b!GtLQTMU726XXXXY5F2BBNi14')
--You can get DriveId by selecting from 'Drives' table.
List root [Read more...]
Lists items at a root level
SELECT * FROM list_root
WITH (DriveId='b!GtLN726LE0eY5F2BBNi14wa')
--You can get DriveId by selecting from 'Drives' table.
List items in a folder (Non-Recursive) [Read more...]
Lists items in a folder
SELECT *
FROM list_folder
WITH(
Filter='$.value[*]' --list both files and folders
--Filter='$.value[?(@.file.mimeType != null)]' --list only files
--Filter='$.value[?(@.folder.childCount != null)]' --list only folders
,DriveId='b!0zqXLXXJh0uUMzl-JXAd9Ztngc-5utVDqRyD2lKpD2535-11HLQTR5z4hOzmA7Q0'
--,FolderId='01R65QTTUIVFJ6HVJ2WBC37KCAOQRKX7PP' --exact Id of Folder
--,FolderId='root' --default is root if FolderId is not passed
--,FolderId='root:/Documents/My Projects:'
--,FolderId='root:/Documents/My Projects/Sample Project:'
)
--You can get DriveId by selecting from 'Drives' table.
--You can get FolderId by selecting from 'list_root' table OR selection from 'list_folder'.
List files in a folder path (Recursive) [Read more...]
Use list_files endpoint to list files recursivly (list from child folder). However there are some limitations to list recursively, such as some new files may not appear right away or files not indexed wont show up.
SELECT * FROM list_files
WITH(
Filter='$.value[*]' --list both files and folders
--Filter='$.value[?(@.file.mimeType != null)]' --list only files
--Filter='$.value[?(@.folder.childCount != null)]' --list only folders
,DriveId='b!GtLN726LE0eY5F2BBNi14wMKmwdpCDFMn1d71ra11GuQ4DORpHy-Sa5UzSpkaY9E'
--,SearchPath='/root' --folder path
--,SearchPath='/root:/myfolder:' --folder path
,SearchPath='/root:/myfolder/subfolder:' --folder path nested
,OrderBy='lastModifiedDateTime desc'
)
--You can get DriveId by selecting from 'Drives' table.
--You can get SearchPath by selecting from 'list_root' table OR selection from 'list_folder'.
List files from Group / other User's drive [Read more...]
This example shows how to read files from Group or other User's drive. You must use SearchType='children' for this purpose (known issue: recursive option may not work correctly in some cases).
SELECT * FROM list_files
WITH(
GroupOrUserId='/groups/138eb458-84f0-4928-bbe6-df663bd1fcea'
, DriveId='b!VxnFPrt3C0GQnQ70Skx-p9_Eqvvac5pGhvqzoRdUpnZb-G5HVC0WTbLU3a89b4LJ'
, SearchType='children'
, SearchPath='/root:/folder/subfolder:'
--, Filter='$.value[*]' --list both files and folders
--, Filter='$.value[?(@.folder.childCount != null)]' --list only folders
)
List folders in a folder [Read more...]
Lists folders in a folder
SELECT * FROM list_folder
WITH (DriveId='b!GtLN726LE0eY5F2BBNi14wa',
FolderId='atLNa26LE0eYFa2BeNi1awa',
Filter='$.value[?(@.folder)]')
--You can get DriveId by selecting from 'Drives' table.
--You can get FolderId by selecting from 'list_root' table OR selection from 'list_folder'.
List files in a folder [Read more...]
Lists files in a folder
SELECT * FROM list_folder
WITH (DriveId='b!GtLN726LE0eY5F2BBNi14wa',
FolderId='atLNa26LE0eYFa2BeNi1awa',
Filter='$.value[?(@.file)]')
--You can get DriveId by selecting from 'Drives' table.
--You can get FolderId by selecting from 'list_root' table OR selection from 'list_folder'.
List Excel files [Read more...]
Lists Excel files in a specified drive
SELECT * FROM list_excel_files
WITH (DriveId='b!GtLN726LE0eY5F2BBNi14')
--You can get DriveId by selecting from 'list_drives' endpoint.
List Excel file Worksheets [Read more...]
Enumerates Worksheets that are part of Excel file
SELECT * FROM list_excel_worksheets
WITH (DriveId='b!GtLN726LE0eY5F2BBNi14'
,FileId='01SUOJPKECYDDVFZWXXXXXXXXXXXXXXXXX')
--DriveId can be retrieved by selecting from 'list_drives' endpoint.
--FileId can be retrieved by selecting from 'list_excel_files' endpoint.
Read Excel Worksheet data - Auto Detect Range [Read more...]
Reads an Excel file without supplying Cell Address Range (It auto detects based on first and last cell)
SELECT * FROM get_excel_worksheet_autodetect
WITH (
DriveId='b!GtLN726LE-XXXXXXXXXXX'
,FileId='01SUOJPFXXXXXXXXXXXXXXXXXX'
,SheetId='Sheet1' --Id or Name
--,SheetId='{00000000-0001-0000-0000-000000000000}' --Using ID is good idea if Sheet ever renamed (Id doesnt change)
,AutoDetectByValue='true'
,ArrayTransEnableCustomColumns='True' --set this to False if No header in first row
)
--DriveId can be retrieved by selecting from 'Drives' table.
--FileId can be retrieved by selecting from 'list_files' endpoint.
--SheetId can be retrieved by downloading Excel file and discovering what sheets exist or by selecting from 'list_excel_worksheets' endpoint.
Read Excel Worksheet data for a specified Cell Address Range [Read more...]
Reads an Excel file from a specified Cell Range. To automatically read without cell range use other endpoint get_excel_worksheet_autodetect
SELECT * FROM get_excel_worksheet
WITH (
DriveId='b!GtLN726LE-XXXXXXXXXXX'
,FileId='01SUOJPFXXXXXXXXXXXXXXXXXX'
,SheetId='Sheet1' --Id or Name
,Range='A1:K10000'
,ArrayTransEnableCustomColumns='True' --set this to False if No header in first row
)
--DriveId can be retrieved by selecting from 'Drives' table.
--FileId can be retrieved by selecting from 'list_files' endpoint.
--SheetId can be retrieved by downloading Excel file and discovering what sheets exist or by selecting from 'list_excel_worksheets' endpoint.
--Range should be set to Excel-type of range where data is located.
Upload a file to OneDrive [Read more...]
Uploads a file to a OneDrive
SELECT * FROM upload_file
WITH (DriveId='b!GtLN726LE0eY5F2BBNi14'
,SourceFilePath='C:\My files\Employees\List.xls'
,TargetFilePath='List.xlsx' --Upload on Root (Create -or- Overwrite if ConflictBehavior = 'replace')
--,TargetFilePath='myfolder/List.xlsx' --Upload under some folder
--,TargetFilePath='01SUOJPKGJXIXXGXACFVDK3QH5JYARFOMB' --Overwrite Exising File Id
--,ConflictBehavior = 'replace' -- fail, rename, replace (If File Exists Default=fail)
--,UseSourceFileTimeStamp = 'true' --By default uploaded file set Current Date/Time for Creation/Modified date
)
--DriveId can be retrieved by selecting from 'list_drives' endpoint.
Upload a file to OneDrive (Overwrite file if exists) [Read more...]
Uploads a file to a OneDrive and if file already exists then overwrite it rather than throwing error (Default is throw error)
SELECT * FROM upload_file
WITH (DriveId='b!GtLN726LE0eY5F2BBNi14'
,SourceFilePath='C:\My files\Employees\List.xls'
,SourceFilePath='C:\My files\Employees\List.xls'
,TargetFilePath='List.xlsx' --Upload on Root (Create -or- Overwrite if ConflictBehavior = 'replace')
--,TargetFilePath='myfolder/List.xlsx' --Upload under some folder
--,TargetFilePath='01SUOJPKGJXIXXGXACFVDK3QH5JYARFOMB' --Overwrite Exising File Id
,ConflictBehavior = 'replace' -- fail, rename, replace (If File Exists Default=fail)
--,UseSourceFileTimeStamp = 'true' --By default uploaded file set Current Date/Time for Creation/Modified date
)
--DriveId can be retrieved by selecting from 'list_drives' endpoint.
Upload a file with original timestamp (For Created/Modified Date) [Read more...]
Uploads a file to a OneDrive and use original creation/modified on date. By default it uses Upload time to set creation/modified on date time. Set UseSourceFileTimeStamp if you like to use original timestamp. This is useful if file was created few days back but Upoloaded later on.
SELECT * FROM upload_file
WITH (DriveId='b!GtLN726LE0eY5F2BBNi14'
,SourceFilePath='C:\My files\Employees\List.xls'
,TargetFilePath='Uploads/Employees/List.xls'
,ConflictBehavior = 'replace' -- fail, rename, replace (If File Exists Default=fail)
,UseSourceFileTimeStamp = 'true' --By default uploaded file set Current Date/Time for Creation/Modified date
)
--DriveId can be retrieved by selecting from 'list_drives' endpoint.
Download a file [Read more...]
Downloads a file from OneDrive
SELECT * FROM download_file
WITH (DriveId='b!GtLN726LE0eY5F2BBNi14'
,FileId='01SUOJPKHXMPKD2UXXXXXXXXXXXXXXXXXX'
,TargetFilePath='C:\My files\Employees\List.xlsx')
--DriveId can be retrieved by selecting from 'list_drives' endpoint.
--FileId can be retrieved by selecting from 'list_files' endpoint.
Delete a file/folder [Read more...]
Deletes a file or folder in OneDrive
SELECT * FROM delete_item
WITH (DriveId='b!GtLN726LE0eY5F2BBNi14'
,ItemId='01SUOJPKHXMPKD2UXXXXXXXXXXXXXXXXXX'
)
--Using Table Name instead of endpoint (with Id / Path in WHERE clause for simple Syntax)
--************
--Delete File by ID or Path
--************
--DELETE From Files Where Id='01N3NI7YU6DYBSLCEDKBB23CR4FSWZYSDJ'
--DELETE From Files Where Id='root:/test_out.csv:'
--DELETE From Files Where Id='root:/somefolder/test_out.csv:'
--************
--Delete Folder by ID or Path
--************
--DELETE From Folders Where Id='01N3NI7YU6DYBSLCEDKBB23CR4FSWZYSDJ'
--DELETE From Folders Where Id='root:/somefolder:'
--DELETE From Folders Where Id='root:/somefolder/childfolder:'
--DriveId can be retrieved by selecting from 'list_drives' endpoint.
--FileId can be retrieved by selecting from 'list_folder' or 'list_root' endpoints.
Create / Update a CSV File in OneDrive from External Data Source (e.g. MSSQL / ODBC) [Read more...]
This example shows how to create / update a CSV file directly on OneDrive using streaming approach. This example reads records from Microsoft SQL Server database and writes data to CSV file on OneDrive. If file does not exists then it creates a new one.
INSERT INTO FileReaderWriterCsv
SOURCE( 'MSSQL'--OR 'ODBC'
, 'Data Source=localhost;Initial Catalog=Northwind;Integrated Security=true'
, 'select OrderId,CustomerId,OrderDate FROM Northwind.dbo.Orders'
)
WITH(
DriveId='b!XpzQciaV_k6my5II5L22J0C4iRhyz21Js89PUyZ6-w0lH0AYv_I8RJHpXZQ81efD'
, FileId='root:/test_out.csv:'
--, FileId='root:/subfolder/test_out.csv:'
--, FileId='01N3NxxxxxxxWZYSDJ' --exising File ID
--, ContinueOn404Error=0 --Fail if file not found (Useful for overwrite mode for exising file)
--, FileId='01N3NI7YU6DYBSLCEDKBB23CR4FSWZYSDJ' --exising File ID for overwrite action
--, ColumnDelimiter=',' --{LF}, {TAB}, | , \x0009 ...
--, RowDelimiter='{NEWLINE}' --{LF}, {TAB}, | , \x0009 ...
--, HasColumnHeaderRow=0 --set for header less file
--, WriterDateTimeFormat='yyyy-MM-ddTHH:mm:ss.fff'
--See Query Builder for more options
)
Create / Update a JSON File in OneDrive from External Data Source (e.g. MSSQL / ODBC) [Read more...]
This example shows how to create / update a JSON file directly on OneDrive using streaming approach. This example reads records from Microsoft SQL Server database and writes data to JSON file on OneDrive. If file does not exists then it creates a new one. It uses LayoutMap to generate JSON with custom layout.
INSERT INTO FileReaderWriterJson
SOURCE( 'MSSQL'--OR 'ODBC'
, 'Data Source=localhost;Initial Catalog=Northwind;Integrated Security=true'
, 'select OrderId,CustomerId,OrderDate FROM Northwind.dbo.Orders'
)
WITH(
DriveId='b!XpzQciaV_k6my5II5L22J0C4iRhyz21Js89PUyZ6-w0lH0AYv_I8RJHpXZQ81efD'
, FileId='root:/test_out.json:'
--, FileId='root:/subfolder/test_out.json:'
--, FileId='01N3NxxxxxxxxxxWZYSDJ' --exising File ID
--, ContinueOn404Error=0 --Fail if file not found (Useful for overwrite mode for exising file)
, JsonOutputFormat='Multicontent' --Default , Array2D, ArrayLines ...
--, DoNotOutputNullProperty='True'
--, Encoding='UTF8' --UTF8WithoutBOM
--, WriterDateTimeFormat='yyyy-MM-ddTHH:mm:ss.fff'
--Example#1: Output all columns
, LayoutMap='<?xml version="1.0" ?>
<settings>
<dataset id="root" main="True" readfrominput="True" />
<map src="*" />
</settings>'
--Example#2: Nested JSON (Records under an array)
/*
, LayoutMap='<?xml version="1.0" ?>
<settings singledataset="True">
<dataset id="root" main="True" readfrominput="True" />
<map name="MyArray" dataset="root" maptype="DocArray">
<map src="OrderID" name="OrderID" />
<map src="OrderDate" name="OrderDate" />
</map>
</settings>'
*/
--Example#3: Nested JSON (Records under a sub document section)
/*
, LayoutMap='<?xml version="1.0" ?>
<settings>
<dataset id="dsRoot" main="True" readfrominput="True" />
<map name="NestedSection">
<map src="OrderID" name="OrderID_MyLabel" />
<map src="OrderDate" name="OrderDate_MyLabel" />
</map>
</settings>'
*/
)
Read CSV File from OneDrive (Parse Rows and Columns without downloading) [Read more...]
This example shows how to read a CSV file from OneDrive without downloading on the Disk (Streaming approach).
SELECT * from get_csv_file
WITH(
DriveId='b!0zqXLXXJh0uUMzl-JXAd9Ztngc-5utVDqRyD2lKpD2535-11HLQTR5z4hOzmA7Q0'
, FileId='root:/dump.csv:'
--, FileId='01N3NI7YRUO2UHV2TUMBGJ4H4QQMWCG6DA'
--, FileId='root:/myfolder/dump.csv:'
--, ColumnDelimiter=',' --{LF}, {TAB}, | , \x0009 ... default is comma (",")
--, HasColumnHeaderRow=0 --set for header less file
--, FileId='root:/myfolder/test_out.csv.gz:'
--, FileCompressionType='GZip' --None, GZip, Zip
)
--SELECT * FROM get_csv_file WITH(FileId='01N3NI7YQA6I2F7YAXBBCZCLLPTRFLANAX')
--SELECT * FROM get_csv_file WITH(FileId='root:/dump.csv:')
--SELECT * FROM get_csv_file WITH(FileId='root:/Documents/dump.csv:')
--SELECT * FROM get_csv_file WITH(FileId='root:/Documents/SubFolder/dump.csv:')
Read Zip/Gzip Compressed CSV File from OneDrive (Parse Rows and Columns without downloading) [Read more...]
This example shows how to read a compressed CSV file (Zip or Gzip) from OneDrive without downloading on the Disk (Streaming approach).
SELECT * from get_csv_file
WITH(
DriveId='b!0zqXLXXJh0uUMzl-JXAd9Ztngc-5utVDqRyD2lKpD2535-11HLQTR5z4hOzmA7Q0'
, FileId='root:/myfolder/dump.csv.zip:'
--, FileId='01N3NI7YRUO2UHV2TUMBGJ4H4QQMWCG6DA'
--, ColumnDelimiter=',' --{LF}, {TAB}, | , \x0009 ... default is comma (",")
--, HasColumnHeaderRow=0 --set for header less file
--, FileId='root:/MyFolder/dump.csv.gz:'
, FileCompressionType='Zip' --None, GZip, Zip
)
Read JSON File from OneDrive (Parse Rows and Columns without downloading) [Read more...]
This example shows how to read a JSON file from OneDrive without downloading on Disk (Streaming approach).
SELECT * from get_json_file
WITH(
DriveId='b!0zqXLXXJh0uUMzl-JXAd9Ztngc-5utVDqRyD2lKpD2535-11HLQTR5z4hOzmA7Q0'
, FileId='root:/myfolder/dump.json:'
--, FileId='01N3NI7YRUO2UHV2TUMBGJ4H4QQMWCG6DA'
, Filter='$.store.books[*]' --or just blank (see help file for more filter examples)
--to read compressed file use below way
--, FileId='root:/myfolder/dump.json.gz:'
--, FileCompressionType='GZip' --None, GZip, Zip
)
--SELECT * FROM get_json_file WITH(FileId='01N3NI7YQJMKXUWUAQGJEJJJNSGVT7QSJ3')
--SELECT * FROM get_json_file WITH(FileId='root:/dump.json:')
--SELECT * FROM get_json_file WITH(FileId='root:/Documents/dump.json:')
--SELECT * FROM get_json_file WITH(FileId='root:/Documents/SubFolder/dump.json:')
Read Zip/Gzip Compressed JSON File from OneDrive (Parse Rows and Columns without downloading) [Read more...]
This example shows how to read a compressed JSON file (Zip or Gzip) from OneDrive without downloading on the Disk (Streaming approach).
SELECT * from get_json_file
WITH(
DriveId='b!0zqXLXXJh0uUMzl-JXAd9Ztngc-5utVDqRyD2lKpD2535-11HLQTR5z4hOzmA7Q0'
, FileId='root:/myfolder/dump.json.zip:'
--, FileId='01N3NI7YRUO2UHV2TUMBGJ4H4QQMWCG6DA'
, Filter='$.store.books[*]' --or just blank (see help file for more filter examples)
, FileCompressionType='Zip' --None, GZip, Zip
)
Move a File or Folder in OneDrive [Read more...]
This example shows how to move a file or folder to a different location in OneDrive. It also shows how to use Placeholder Functions to name file daynamically. For example to add timestamp it uses <<yyyy-MM-dd-HH-mm-ss-fff,FUN_NOW>>
SELECT * FROM move_rename_item
WITH(
--Source Drive
DriveId='me'
--OR--
--DriveId='b!7HBaTtrbekqMYJQ-OqV5Q3hrcOIQoyhGiAoWjqWFenIlIJ-Us7DMQ6jvyrsWMJPx'
--Source Item
--Item Id (File or Folder) you like to move or rename
, ItemId='01R65QTTRARZ42C4BN6FF2WOH3AONX4GUW'
--Target Drive Id (Optional): Only needed if moving file to a different Drive (e.g. another User's drive)
--, TargetDriveId='me'
--OR
--, TargetDriveId='b!0zqXLXXJh0uxxxxxxxxxxxxxxxxxxxxx'
--Target Folder
, TargetFolderId='01R65QTTTBPH6V2AP36VD33CYYDXJSNHLN'
--OR (for moving to root)
--, TargetFolderId='root'
--Target Item Name (New Name) after Move (Optional) - If you do not wish to change name after Move then do not supply below
--, TargetItemName='new_file_name_<<yyyy-MM-dd-HH-mm-ss-fff,FUN_NOW>>.pdf'
--Uncomment Below if you get error. Usually needed for large file or cross site operations
--, Prefer='respond-async'
)
Rename a File or Folder in OneDrive [Read more...]
This example shows how to rename a file or folder and you can also move to a different location in OneDrive.. It also shows how to use Placeholder Functions to name file daynamically. For example to add timestamp it uses <<yyyy-MM-dd-HH-mm-ss-fff,FUN_NOW>>
SELECT * FROM move_rename_item
WITH(
--Source Drive
DriveId='me'
--OR--
--DriveId='b!7HBaTtrbekqMYJQ-OqV5Q3hrcOIQoyhGiAoWjqWFenIlIJ-Us7DMQ6jvyrsWMJPx'
--Source Item you like to rename or move
, ItemId='01R65QTTRARZ42C4BN6FF2WOH3AONX4GUW'
--Target Drive Id (Optional): Only needed if moving file to a different Drive (e.g. another User's drive)
--, TargetDriveId='me'
--OR
--, TargetDriveId='b!0zqXLXXJh0uxxxxxxxxxxxxxxxxxxxxx'
--Target Folder (Optional): If you are doing Rename and Move both in one action then supply new Folder Id too else keep it blank for just rename
--, TargetFolderId='01R65QTTTBPH6V2AP36VD33CYYDXJSNHLN'
--, TargetFolderId='root'
--Target Item Name (New name)
, TargetItemName='new_file_name_<<yyyy-MM-dd-HH-mm-ss-fff,FUN_NOW>>.pdf'
--Uncomment Below if you get error. Usually needed for large file or cross site operations
--, Prefer='respond-async'
)
Copy a File or Folder in OneDrive [Read more...]
This example shows how to copy a file or folder to a different location in OneDrive (In same Drive or different User's drive). It also shows how to use Placeholder Functions to name file daynamically. For example to add timestamp it uses <<yyyy-MM-dd-HH-mm-ss-fff,FUN_NOW>>
SELECT * FROM copy_item
WITH(
--Source Drive
DriveId='me'
--OR--
--DriveId='b!7HBaTtrbekqMYJQ-OqV5Q3hrcOIQoyhGiAoWjqWFenIlIJ-Us7DMQ6jvyrsWMJPx'
--Source Item you like to copy
, ItemId='01R65QTTRARZ42C4BN6FF2WOH3AONX4GUW'
--Target Drive Id (Optional): Only needed if copying file to a different Drive (e.g. another User's drive)
--, TargetDriveId='me'
--OR--
--, TargetDriveId='b!0zqXLXXJh0uxxxxxxxxxxxxxxxxxxxxx'
--Target Folder where item will be copied
, TargetFolderId='01R65QTTTBPH6V2AP36VD33CYYDXJSNHLN'
--OR--
--, TargetFolderId='root'
--Target item name (Optional) - Only needed if new name needed after copy
, TargetItemName='new_file_or_folder_name_<<yyyy-MM-dd-HH-mm-ss-fff,FUN_NOW>>.pdf'
--,ConflictBehavior='replace' --fail, rename (Ignored if TargetItemName is not supplied)
--Uncomment Below if you get error. Usually needed for large file or cross site operations
--, Prefer='respond-async'
)
Download File and convert to PDF or HTML file format (convert xlsx, docx, pptx and many more) in OneDrive [Read more...]
This example shows how to download a file with different format (PDF or HTML). If conversion not supported you will get an error.
SELECT "Status"
FROM download_file
WITH(
DriveId='me'
--OR--
--DriveId='b!7HBaTtrbekqMYJQ-OqV5Q3hrcOIQoyhGiAoWjqWFenIlIJ-Us7DMQ6jvyrsWMJPx'
, FileId='01R65QTTTF7H7WMCHCKRFJGEJTXAEC7RGX'
--Supported Source Formats: csv, doc, docx, odp, ods, odt, pot, potm, potx, pps, ppsx, ppsxm, ppt, pptm, pptx, rtf, xls, xlsx
, ConvertTo='pdf'
, TargetFilePath='C:\temp\converted.pdf'
--OR--
--Supported Source Formats: loop, fluid, wbtx
--, ConvertTo='html'
--, TargetFilePath='C:\temp\converted.html'
)
Conclusion
In this article we discussed how to connect to OneDrive in Informatica and integrate data without any coding. Click here to Download OneDrive Connector for Informatica and try yourself see how easy it is. If you still have any question(s) then ask here or simply click on live chat icon below and ask our expert (see bottom-right corner of this page).
Download OneDrive Connector for Informatica
Documentation
More integrations
Other application integration scenarios for OneDrive
Other connectors for Informatica
Download OneDrive Connector for Informatica
Documentation
How to connect OneDrive in Informatica?
How to get OneDrive data in Informatica?
How to read OneDrive data in Informatica?
How to load OneDrive data in Informatica?
How to import OneDrive data in Informatica?
How to pull OneDrive data in Informatica?
How to push data to OneDrive in Informatica?
How to write data to OneDrive in Informatica?
How to POST data to OneDrive in Informatica?
Call OneDrive API in Informatica
Consume OneDrive API in Informatica
OneDrive Informatica Automate
OneDrive Informatica Integration
Integration OneDrive in Informatica
Consume real-time OneDrive data in Informatica
Consume real-time OneDrive API data in Informatica
OneDrive ODBC Driver | ODBC Driver for OneDrive | ODBC OneDrive Driver | SSIS OneDrive Source | SSIS OneDrive Destination
Connect OneDrive in Informatica
Load OneDrive in Informatica
Load OneDrive data in Informatica
Read OneDrive data in Informatica
OneDrive API Call in Informatica