The Get File/Folder activity from the Microsoft 365 package should be used to retrieve the Driveitem ID for a Sharepoint URL. This activity allows you to get information about a specific file or folder from OneDrive or SharePoint, such as the name, size, ID, URL, etc. You can specify the file or folder to be retrieved by browsing, entering the ID, or entering the URL1.
To get the Driveitem ID for a Sharepoint URL, you need to do the following steps:
Use the Get File/Folder activity and select the Enter Url option in the File or folder to get property.
Enter the Sharepoint URL of the file or folder in the File or folder Url property. For example, 5.
Create a variable of type Microsoft.Graph.DriveItem in the Output property. For example, driveItem.
Use an Assign activity to get the Driveitem ID from the output variable. For example, driveItemId = driveItem.Id.
The other options are not activities that can be used to retrieve the Driveitem ID for a Sharepoint URL, because they either do not have an output property that returns the Driveitem ID, or they do not have an input property that accepts the Sharepoint URL. For example:
The Get Group activity gets information about a specific group from Microsoft 365, such as the name, ID, description, etc. It does not have an output property that returns the Driveitem ID, nor an input property that accepts the Sharepoint URL2.
The Share File/Folder activity shares a file or folder with the specified recipients. It does not have an output property that returns the Driveitem ID, but only the sharing link and the expiration date3.
The Download File activity downloads a file from OneDrive or SharePoint to a local folder. It does not have an output property that returns the Driveitem ID, but only the local path of the downloaded file4.
References:
1: Get File/Folder - UiPath Activities 2: Get Group - UiPath Activities 3: Share File/Folder - UiPath Activities 4: Download File - UiPath Activities