Reputation: 1
I have very limited coding skills so I used make.com for automation purpose. I have automated our client onboarding process but there are two things I cant achieve.
When a new client is onboarded, a new folder in our google drive is created. this folder is named "client name - city". Our client folders are organized in folders "drive/client/a" ; "drive/client/b" etc. What I want to achieve, is that the folder gets moved into the right folder (Example: Client Folder is "Tesla Inc" it should be moved into "drive/client/t"
I have tried ChatGPT and this is the script it sent me:
# Zielordner basierend auf dem Anfangsbuchstaben des Ordners bestimmen
destination_folders = {
'A': '456def', # ID des Ordners für den Buchstaben "A"
'B': '789ghi', # ID des Ordners für den Buchstaben "B"
# ... weitere Einträge für alle Buchstaben des Alphabets ...
}
first_letter = folder_name[0]
destination_folder_id = destination_folders.get(first_letter, None)
if destination_folder_id is None:
print(f'Kein Zielordner gefunden für den Anfangsbuchstaben {first_letter}. Der Ordner wird nicht verschoben.')
else:
# Ordner in Zielordner verschieben
file_metadata = {
'parents': [destination_folder_id]
}
try:
result = drive_service.files().update(fileId=new_folder_id, body=file_metadata).execute()
print(f'Ordner {new_folder_id} wurde in den Ordner {destination_folder_id} verschoben.')
except HttpError as error:
print(f'Fehler beim Verschieben des Ordners: {error}')
I have already created an google sheet with all IDs to every letter of the alphabet. This can easily be implemented into the script, but Im not sure, how to solve this problem and move to the next step. Can anyone help?
Cheers Ismar
I have tried several modules within make.com but none of them had the functionality I needed. I also tried to perform a google sheet function to solve this, but always ended up not knowing how to implement this into make.com
Upvotes: 0
Views: 27
Reputation: 23
You can build that specific automation by making use of the text function "split" in your modules.
Meaning, you can split the folder name, get the 1st letter, and then let it move into the correct alphabet folder.
Upvotes: 0