OneDrive download trigger file

Hello guys, how are you doing today ? I may need your help on a OneDrive automation !

I want to, each time I upload a file into a specified folder, get the automation running (get the file that triggered the automation> download (then i modify) > upload to another folder).

So I set a trigger, (File created) creating a variable in output called “createdfile” whos type is o365remoteobject.
I then use 'get file or folder" with the folder ID and create another variable called “wanted file” ((yes very original))
The thing is that afterwards, I want to download the file that triggered my automation but I don’t really know how to do it, if I need an assign activity or else…

To after download the file and on and on.

Do you have any insights to share ? thanks in advance

Hi,

File Created Trigger → Outputs to createdFile
Get File or Folder → Input: ID from createdFile, Output to wantedFile
Download File → Input: wantedFile
[Modify the File Locally]
Upload File → Input: modified file path, Destination folder ID…

if not solved, reply me…i will give detailed flow

Hello, thanks a lot for your answer !

I understood the process, but i have this error when getting the file:
“Argument ‘ItemId’: BC30311: Value of type ‘O365DriveRemoteItem’ cannot be converted to ‘String’. The selected value is incompatible with the property type.”

Createdfile is o365driveitem while wanted file… Well I didn’t put a type yet so string by default.

Another question is how can I get the ID from createdfile ?

thanks for your answer :slight_smile:

  1. Correct Variable Type*:
  • Change the type of your wanted file variable to O365DriveItem or O365DriveRemoteItem, depending on the output type from your activities.
  1. Extract File ID*:
  • Use an Assign activity to extract the ID from the createdFile object

Code:
createdFileId = createdFile.Id

  1. Use the Correct ID in Download Activity*:
  • Make sure to use the createdFileId as a string in the Download File activity.

Adjust Workflow

  • Assign File ID**: Extract the Id from createdFile using createdFile.Id.
  • Download File**: Use this ID in your Download File activity to correctly identify the file to download.

This adjustment ensures that you are using the correct data types and the specific file ID needed for the Download File activity.

Hey, thanks again for your answer.

As you said, I changed wantedfile variable to 0365DriveRemoteItem and I tried to assign
CreatedFile = CreatedFile.ID

Got this error “Argument ‘Value’: BC30311: Value of type ‘String’ cannot be converted to ‘O365DriveRemoteItem’. The selected value is incompatible with the property type.”

Do you have any ideas ? Once again, thanks for helping me