Power Automate - Automatically fetch data from Power BI in to Excel and Send the copy of the Excel file via Email

Power Automate - Automatically fetch data from Power BI in to Excel and Send the copy of the Excel file via Email

Step-1
Step-2
Step-3
Using Command text we can make changes in the data we fetch from the Power BI.
Like add fields/columns, filter data, rename columns. It is a DAX formula.
Step-4
Step-5
    
Step-6
Step-7
Posting message on Teams.
We can post message to a Teams Group also by selecting Group chat from Post in and select the Teams Group from the Group chat dropdown that will appear after making selection.
Step-8
Location: We need to select the Group on SharePoint in which our file is located.
Document Library: We need to select the Documents option from the dropdown.
File: Select the file on which you want to run the script.
Script: Select the script to perform the desired action.
Step-9
Step-10
Step-11
Using Filter Query we can decide which file properties we want to get.
We are performing this step to attach excel as an attachment in email.
You can find more info in Step-11 ++
Step-12
Get Excel File to attach in email.
Step-13
Step-14
Here we are attaching excel file in email.
Step-15
Step-16

Step-11 ++
Filter Query - Partial Search

🛠 Filter Query Syntax for Partial Match:
substringof('partial_text', FileLeafRef)
Explanation:

substringof: Checks if the specified text exists in the target field.
partial_text: Replace this with the text you want to search for.
FileLeafRef: The internal name for the file name field in SharePoint.

🔍 Example 1: Search Files Containing "Report" in Name
substringof('Report', FileLeafRef)
This will match files like:

MonthlyReport.xlsx
Report_2025.pdf
Sales_Report_Q1.docx

🔍 Example 2: Search Files Containing "Invoice" in Any Part of Name
substringof('Invoice', FileLeafRef)
Matches:

Invoice_123.pdf
2025_Invoice_Summary.xlsx
InvoiceDetails.docx

🛑 Important Considerations:
Case-Sensitive: substringof is case-sensitive. For a case-insensitive search, you’ll need to adjust the query.
Spaces in Names: If your search text contains spaces, enclose the whole query in single quotes:
substringof('Sales Report', FileLeafRef)
No Wildcards: SharePoint OData doesn’t support * or % as wildcards. Use substringof instead.

🎉 Summary:
Use substringof('text', FileLeafRef) for partial name matches.
Replace 'text' with the part of the file name you want to find.
This should help you find files based on partial matches in Power Automate! 😊

Partial Search with File Type

🔍 Example 1: Search for Files Containing "Report" and Ending with .xlsx
substringof('Report', FileLeafRef) and endswith(FileLeafRef, '.xlsx')

🔍 Example 2: Search for Files Containing "Invoice" and Ending with .pdf
substringof('Invoice', FileLeafRef) and endswith(FileLeafRef, '.pdf')


Comments

Popular posts from this blog

Function to Paste Excel Range on Outlook Mail Body (In text not image) Function Name - rngHTML()

Separate Text (Characters) & Numbers from Alpha Numeric String Using Formula and Macro (VBA)