I've done that where I need to store PDF's, have a name in a param on the script. Search for the folder, does it exist ? no, create it, yes, I have the id. Then use the id to create the files in that folder or search for existing files where the parent matches the folder id. Sorry I'm talking out loud, not meaning to sound like I'm teaching you to suck eggs 😉