I have some issues with Power Automate.
When using Sharepoint, I would like to notify a recipient when a new file with a specific extension and file name is created.
For example, I want to send a mail to firstname.lastname@example.org that an Excel file with file name starting with "12345" has been saved on this link.
However, I cannot find any options for filtering for file extensions or file names in my flow.
Can anybody help me please if such filtering is possible?
Thank you in advance
I'm not an expert but may I ask which trigger you use? if it's the creation or modification of an item in a sharepoint document library, maybe you could create a variable with the extension trimming the filename of the created file then you could use a conditional check
I'm not a pro too but I'll try to help, so the trigger must be "when a file is created in a folder"
then let's init a variable spliting the file identifier from the trigger: split(triggerOutputs()?['headers/x-ms-file-id'], '.')
then init the Extension variable
alternative/in addition with "GET FILE METADATA" using the same file identifier from the trigger you can get other info, like the filename or the media type
Then you can use conditional control to perform specific action if it's an image, doc, xlsx etc etc.
I hope that this will help you ^_^
thanks for the help.
When testing the flow, I got this error message for Initialize variable 2:
"Unable to process template language expressions in action 'Initialize_variable_2' inputs at line '0' and column '0': 'The template language function 'split' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#split for usage details.'."
I suppose I have to adjust something in this command?
Your trigger is different than mine
it's not a problem but you can't copy paste my previous command, with this trigger it will change as:
due the trigger answers with a different set of properties
Thank you a lot, it worked!
Do you know if there is an option to limit the automated e-mail sending to a special file names only? For instance, there are many files created on a link, but I only want to send notification if an excel file containing the name "12345" is created.
Thanks in advance.
I'm glad it worked, about the mail you should add a conditional step before the mail sending phase, with two conditions, extension eq xlsx AND filename contains "12345"