I am have a simple request, I wish to check a folder exists on a sharepoint site. If that folder does not exist then i wish to create it if not I will upload a file into the existing folder.
What I have done
- I have a Office 365 scope that is connected to my sharepoint site using ApplicationiD and secret authentication.
2, I am using find files and and folders and I have setup the query box as the folder I wish to find, I have added the subfolder path, url and drive name. - I have set a drive item for First item
This is my problem, I do not know how to find handle if the folder was not found, as I cannot reference the driveitem I have created to capture the result as when i do it states object does not exist.
Please can someone advise how I handle the find files and folders in an office 365 scope so I can easily know if a folder was found or not. I was expecting the files and folders tto return boolean to advise found but all it returns is driveitem, then I could easily do if not found create folder.
Obviously an common task but I cannot work out how to do it, any help would really be appreciated.
Thank you.