Hey all
So I thought if I locked everyone down to read only access to a shared folder in Onedrive, that would allow me to update the file even if people have it open to view. Obviously not because my flow fails saying the file is locked.
Is there a way around this? Basically my flow is pretty simple.
1. Email comes in that meet criteria.
2. The attachment in the email is identified.
3. The attachment in the email is copied to folder in OneDrive as the same file name.
4. A teams chat is updated to say here is link to the file.
My issue is, folder is shared as view only, but if someone opens the file and doesn't close it, my flow is stopping at point 3 because it can't overwrite as it says file is locked. Is there a way around this?
Yes, Always use a unique filename. Try it and see if that works.
Unfortunately there are no work around for this. This is by design. The other option is when you copy the filename create the filename using date, hours and seconds to generate a unique name. Use the formatDate(utcNow(), 'dd_MM_yyyy_hh_mm_ss')
You may need to use the split() expression too.
concat(first(split('test.docx','.')),'_',formatDate(utcNow(), 'dd_MM_yyyy_hh_mm_ss'))
This will give you test_29_05_2024_12_42_33
Then to add the extension combine the first expression with another split to get the extension (.docx)
contact(concat(first(split('test.docx','.')),'_',formatDate(utcNow(), 'dd_MM_yyyy_hh_mm_ss')),'.',last(split('test.docx','.')))
Thanks
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional