Is it possible to make the internal ID dynamic in a script?
users will be deleting the file and adding a new one everyday, I'm trying to avoid having to change the internal ID of the file on the script. Any way of making dynamic?
a
Anthony OConnor
09/05/2023, 9:17 PM
no you can't have any control of internal ids.
will the file name rename the same?
Anthony OConnor
09/05/2023, 9:17 PM
oh you mean to reference it?
sure you can do a foldersearch to get the id of files in the folder
👍 2
Anthony OConnor
09/05/2023, 9:18 PM
but if the file name will be the same they don't need to delete, if they're uploading via the file cabinet at least it will prompt them to overwrite existing when it sees the name collision
Anthony OConnor
09/05/2023, 9:19 PM
if its an integration of some kind... you'll need to search for file ids based on folder
w
wbermudo
09/06/2023, 12:35 AM
You can use the file relative path (/SuiteScript/Folder/FileName.csv) instead of the ID assuming your are loading the file and getting it’s content.
n
NElliott
09/06/2023, 7:38 AM
If the filename is static but will be repeatedly deleted you can also do a search by name to retrieve the internalid.