Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Tool Mastery

Explore a diverse compilation of articles that take an in-depth look at Designer tools.
Become a Tool Master

Learn how you can share your expertise with the Community

LEARN MORE

Tool Mastery | One Drive

JakeS
Alteryx Alumni (Retired)
Created

One Drive_output.pngOne Drive_input.png


This article is part of the Tool Mastery Series, a compilation of Knowledge Base contributions to introducediverse workingexamples forDesigner Tools. Here we’ll delve into uses of the OneDrive Tools on our wayto mastering the Alteryx Designer:

IMPORTANT - The following article is accurate for App Registrations that were created prior to October 2020. If you are setting up a new App Registration for a Microsoft Connector, please see this Help Documentation
 

OneDrive is a file hosting and synchronization service operated by Microsoft. You can connect to a OneDrive instance in Alteryx with the OneDrive Input tool and the OneDrive Output tool.

 

The OneDrive tools do not come installed standard with Alteryx. To install them, you can find them here, or by searching for “OneDrive” in the Alteryx Gallery.

 

Connecting to OneDrive:

 

There are two different modes for authentication depending on whether the OneDrive account you'd like to connect to is Personal or for Business. For either form of authentication, you will have to register a new application with Microsoft (Azure) and create a Client ID. If the account type is business, you will also need to generate a secret key.

 

How to Create a registered application in Azure:

 

1. Go to the Azure Application Registration Portal

2. When prompted, sign in with your account credentials.

3. Select "New Registration":

 

NewRegistration.png

 

4. This will prompt you to enter a name for the application, the supported account types, and the redirect URI. Select either of the multitenant options (You may have to work with your Azure admin to determine which will be best for you) and enter https://login.live.com/oauth20_desktop.srf as the redirect URI. This is required for the OneDrive tools to connect.

 

RegisterAnApplication.png

 

5. Once the app is created, an application ID will automatically be created. This is the Client ID that is used in Alteryx to login to the app:

FinishedRegistration.png

 

6. If you are using the application for a OneDrive Business account (organization account) you will need to generate a client secret. This will be entered as the Secret Key when logging in from the OneDrive tool in Alteryx:

 

NewClientSecret.png

 

Once you select "New Client Secret" a secret will be generated. Make sure to copy and paste this somewhere safe, as after you leave the page for the first time, the secret will be hidden. You can always generate a new secret if you lose it.

 

7. Next, you will have to set permissions for the application. You can access API permissions for the application from the application "overview page":

 

ViewAPIpermissions.png

 

There are three delegated permissions required to use the tool (Files.ReadWrite, User.Read, and offline_access).

APIpermissions.png

 

Note* You can achieve necessary permission for the application by selecting other permissions as well. The permissions listed above are the bare minimum for the Alteryx tool to access OneDrive.

 

 

After this is complete, you have everything necessary to log into the OneDrive tool in Alteryx. Additional information on registering an application with Azure can be found here.

 

 

Logging in to the OneDrive tools in Alteryx:

 

Personal: For OneDrive Personal Accounts, you will only need to enter a Client ID:

 

OneDrivePersonalCred.png

 

Business: For OneDrive Business Accounts, you will need both a Client ID as well as a Secret Key that is associated with the application:

 

OneDriveBusinessCred.png


 

Authentication:

 

Once you provide the application credentials, A new window will pop up, and you will be prompted to log in to an account that has access to the OneDrive:

 

OneDriveAuth.png

 

Note* You will have to provide authentication for both OneDrive Input and Output tools, even if you are using them in the same workflow.

 

Once you complete the authentication, the configuration window for the tool will appear.

 

Configuring the OneDrive Input Tool:

 

The OneDrive input tool will allow you to choose multiple specifications for the file you wish to pull in:

 

OneDriveInputConfig2.png

 

 

 

Once you have made all of your selections, run the workflow to pull in the file from OneDrive.

 

 

Configuring the OneDrive Output Tool:

 

 

OneDriveOutputConfig.png

 

Once you have made all the selections that you wish, run the workflow towrite data into OneDrive.

 

Troubleshooting:

 

"We're unable to complete your request" error after logging in:
UnableToCompleteYourRequest.png

-This usually means that you have entered your Client ID or Application Secret incorrectly. Makes sure that you have entered them correctly.

-Also be sure that you have permissions to access the OneDrive.

_______________________________________________________________________________________________________________________

 

Error when reading in JSON: “list index out of range”

onedrivejson.png

Check to make sure that JSON formatting within the files is correct.

 

By now, you should have expert-level proficiency with the OneDrive Input and Output tools! If you can think of a use case we left out, feel free to use the comments section below! Consider yourself a Tool Master already? Let us know at community@alteryx.com if you’d like your creative tool uses to be featured in the Tool Mastery Series.

 

Stay tuned with our latest posts everyTool Tuesdayby followingAlteryxon Twitter! If you want to master all the Designer tools, considersubscribingfor email notifications.



Comments
bunzzz
7 - Meteor

This is super informative and helpful! I believe this may need to be updated because the Microsoft Application Registration Portal has been deprecated and Azure is the new site.

CConwell
6 - Meteoroid

I am getting an error when the One_drive tool tries to install.  It gets to the Collecting pip==19.0.3, but never gets past that point.

JakeS
Alteryx Alumni (Retired)

@CConwell  Certain environments can fail to install tools for a couple of reasons. It could be that we are unable to download the required packages when installing the tool due to proxy or firewall restrictions. It could also be an issue with permissions. I would recommend reaching out to support@alteryx.com so that our support team can dig into the specific reason that the tool installation is failing.

 

Thanks!

 

Jake

garthn555
8 - Asteroid

Why are the Onedrive tools limited to the 3 file types? I would have expected to be able to read any of the input tool supported file types?

JakeS
Alteryx Alumni (Retired)

Hi @garthn555 

 

Thank you for the feedback! When writing data back to OneDrive via the API,  A different function must be created for writing to each file type as writing each of those file types is handled differently. The current tool only has functions included to handle writing JSON, CSV, and AVRO file types. I would recommend liking and posting to this product idea here, and I think it would also be a good place to add any additional file types you would like to see included. 

 

 

Skylarhaws
6 - Meteoroid

Can a flow that has these tools be scheduled and ran on the Alteryx Server? That is my big beef with this kind of stuff, but if its a non issue then this would be fantastic.

pippinsaunders1
5 - Atom

I'm receiving the following error when trying to run the workflow to pull in a CSV. Any ideas for solving this? 

'OneDrive Input (2) There was an error processing your file. Check your quote character configuration'

 

tackloa
5 - Atom

I have followed the steps closely and also used different "Account Types" but no matter what I do, I keep getting the following error (see image attached).

Please help!

 

I understand the error is related to the "Client Secret ID" that is generated when registering the app. And in most cases is related to an expired "Secret ID", but in my case the "Secret ID" is recently generated and due to expire in 6 months, so the error cannot be related to that issue. 

 

I have also tried by "updating/renewing" a new "Secret ID", but doesn't solve the issue either.

 

Please help.

Thanks

Screenshot.png

BharathKG
7 - Meteor

Hi All,

 

I'm very new to Alteryx and please ignore my English if any mistakes.

I have connected to onedrive using the Onedriveoutput tool in Alteryx. Can you explain how can we share the file from one user onedrive to another user onedrive using alteryx. Is it possible on Alteryx