How to get the file from sharepoint and drop the file on sharepoint?

I need to get the files from sharepoint with dynamic file name and also want to drop the file .

@PALKUMARI_PATEL

If you know the folder and if it contains only one file…

Then you can use for each file activity in office365 activities …inside which as there is only one file you will get it

And for delete file

Hope this helps

Cheers

1 Like

Hi @Anil_G I know the folder but I have to choose file with current date. so, basically folder contains multiple files and have to choose current date files.

Also for other project , have to copy current date file and paste the file with rename in same folder.
Is it possible to do with any of the activity ?

Thank You

  1. Use the “Get Files” activity to retrieve all the files in the SharePoint folder.
  2. Use a For Each loop to iterate through the files.
  3. Use the “Path.GetFileNameWithoutExtension” method to get the filename without the extension.
  4. Use the “DateTime.TryParseExact” method to parse the date from the filename using a specific date format.
  5. Use an If activity to compare the parsed date with the current date. If they match, then you have found the file you need.
  6. Use the “Copy File” activity to create a copy of the file with a new name.
  7. Use the “Path.Combine” method to create the new file path with the new filename.
  8. Use the “Move File” activity to move the copied file to the new file path in the same SharePoint folder.

@PALKUMARI_PATEL

You can use the same for each file …and inside that use if condition to check the file with current date…so can use find file/folders with search on current date …both would work…

Yes we can do rename by using copy file and then deete the old file

Hope this helps

Cheers

Hi @PALKUMARI_PATEL ,

Check this below link,

Hope this may help you :slight_smile:

Hi @ABHIMANYU_THITE1 Can you help me how to write sharepoint path in directory.GetFiles ?

Thanks in advanced.

Get file/ folder required to use onedrive/sharepoint activity and that is asking for account access from UiPath. I don’t know how can i get this . Can you help here ?
image

@PALKUMARI_PATEL

You can use this for setting up shreoint access on azure if you have

Or you can use integration service to create a integration with sharepoint using you credentials and then can use the related activities

May I know which way you are trying to access

Cheers

I tried with Azure as you suggested but there is no access . I think need IT permission. Can you guide me on how to use other integration method ?
Thanks

@PALKUMARI_PATEL

Yes you need you IT team…the can create an azure app and give credentials to you…the same process on what permissions are needed and all is there in the documentation

Other way is integration services…you can go to orchestrator and if integration services are enabled in your orchestrator then you can go to that page and select office 365 connector and it would ask you for credentials…check the same

Cheers

Hi @Anil_G Thanks I will ask IT to help in this but why I am getting that admin approval list ? Is it something relate to IT or who handles AZURE ? Do I need to contact Azure admin ?

@PALKUMARI_PATEL

You can contact your sharepoint team
If you want to use integration services

But if your organization has an azure …then you can contact your azure admin…and he would have access to create an azure app with required creds…

That can be used…for unattended bots…you need to ask them to give application role and ehat all roles under it are required is provided in the above doc…they eould need to provide client id client secret and tenant id …so that you can provide them in microsoft application scope

Hope this helps

Cheers

Thanks @Anil_G Can you share me a sample flow with all activities Properties that I need to use sharepoint folder’s file ? It will be very helpful If I confused at some point.

Thanks you

I am able to setup Azure application and Able to use via o365 app scope. Can someone help me to figure out how can I get file names within that folder in sharepoint ?

DriveItem.Name.ToString.Contains(“ABC”) ----- this is giving me true or false only. I want to use and drop files within this folder.

@PALKUMARI_PATEL

You can use for each file in folder

Or driveitem.Name actually gives the name

Cheers

1 Like

Hi @Anil_G Driveitem is just giving the names.

I tried for each file in a folder but it is just trying to find the folder sand file within that project only. How can I use path of sharepoint to get those files ?

Also How Can i move , Access , copy sharepoint files ?

Thanks

@PALKUMARI_PATEL

Okay now i got it…

So say you aregettingn a drive item usign find files and folder…then that drive item is to be used in all thsoe activities you mentioned ypu move…copy…download or upload activities…

Basically find files will give your the drive item which can be used further in almost all activities to access that file or folder

Hope this helps

Cheers

1 Like

I tried but not getting the proper logic to reach to any particular file. Can you please provide me an sample flow? It will be a great help.

Thank You

@PALKUMARI_PATEL

Please check

SampleOffice365.xaml (9.8 KB)

cheers

1 Like