Business Professionals
Power BI | Power Pivot | Power Query | DAX
Cloud Flows | RPA | AI Builder | Copilot
60+ Formulas | Data Stories | Advanced Reporting & Modeling
VB Programming | Report Automation |
MS-Office Automation
Techno-Business Professionals
Power BI | Power Query | Advanced DAX | SQL - Query &
Programming
Microsoft Fabric | Power BI | Power Query | Advanced DAX |
SQL - Query & Programming
Power BI | Power Apps | Power Automate | Copilot Studio | Power Pages | Dataverse
Microsoft Power Apps | Microsoft Power Automate
Power BI | Adv. DAX | SQL (Query & Programming) |
VBA | Python | Web Scrapping | API Integration
Power BI | Power Apps | Power Automate |
SQL (Query & Programming)
Power BI | Adv. DAX | Power Apps | Power Automate |
SQL (Query & Programming) | VBA | Python | Web Scrapping | API Integration
Power Apps | Power Automate | SQL | VBA | Python |
Web Scraping | RPA | API Integration
Technology Professionals
Power BI | DAX | SQL | ETL with SSIS | SSAS | VBA | Python
Power BI | SQL | Azure Data Lake | Synapse Analytics |
Data Factory | Databricks | Power Apps | Power Automate |
Azure Analysis Services
Microsoft Fabric | Power BI | SQL | Lakehouse |
Data Factory (Pipelines) | Dataflows Gen2 | KQL | Delta Tables | Power Apps | Power Automate
Power BI | Power Apps | Power Automate | SQL | VBA | Python | API Integration
Power BI | Advanced DAX | Databricks | SQL | Lakehouse Architecture
Business Professionals
Power BI | Power Pivot | Power Query | DAX
Cloud Flows | RPA | AI Builder | Copilot
60+ Formulas | Data Stories | Advanced Reporting & Modeling
VB Programming | Report Automation |
MS-Office Automation
Techno-Business Professionals
Power BI | Power Query | Advanced DAX | SQL - Query &
Programming
Microsoft Fabric | Power BI | Power Query | Advanced DAX |
SQL - Query & Programming
Power BI | Power Apps | Power Automate | Copilot Studio | Power Pages | Dataverse
Microsoft Power Apps | Microsoft Power Automate
Power BI | Adv. DAX | SQL (Query & Programming) |
VBA | Web Scrapping | API Integration
Power BI | Power Apps | Power Automate |
SQL (Query & Programming)
Power BI | Adv. DAX | Power Apps | Power Automate |
SQL (Query & Programming) | VBA | Web Scrapping | API Integration
Power Apps | Power Automate | SQL | VBA |
Web Scraping | RPA | API Integration
Technology Professionals
Power BI | DAX | SQL | ETL with SSIS | SSAS | VBA
Power BI | SQL | Azure Data Lake | Synapse Analytics |
Data Factory | Azure Analysis Services
Microsoft Fabric | Power BI | SQL | Lakehouse |
Data Factory (Pipelines) | Dataflows Gen2 | KQL | Delta Tables
Power BI | Power Apps | Power Automate | SQL | VBA | API Integration
Power BI | Advanced DAX | Databricks | SQL | Lakehouse Architecture
LEARN THIS HANDS ON
Power Apps & Power Automate
Most Romanian finance teams have already hit this: you go back to ANAF’s e-Factura portal for an invoice from three months ago and it’s gone. ANAF only guarantees access for a limited period, and the portal is not your archive. This article shows a concrete Power Automate flow that automatically downloads and stores every e-Factura XML so you keep control of your own history.
You have a shared mailbox (e.g. facturi@company.ro) where suppliers send e-Factura attachments. Your accounting app doesn’t yet integrate directly with ANAF’s API, so the XMLs in that mailbox are your lifeline.
Pain points:
Target state:
We’ll build a single cloud flow in Power Automate that:
Before building the flow, decide:
Most teams will pick one of:
We’ll use SharePoint in the example, with a library like e-Factura-Archive on a finance site.
You want deterministic, unique file names that help later processing. A robust pattern:
{SupplierName}_{InvoiceNumber}_{IssueDate:yyyyMMdd}_{OriginalFileName}.xml
If you can’t reliably parse supplier or invoice number from the XML today, at minimum:
{ReceivedDate:yyyyMMddHHmmss}_{MessageId}_{OriginalFileName}.xml
We’ll implement the second pattern, because it only relies on email metadata.
Options for the email trigger:
We’ll build on the shared mailbox trigger to match the usual facturi@ pattern.
Assumptions:
https://tenant.sharepoint.com/sites/Finance) with a document library e-Factura-Archive.Archive e-Factura from Shared Mailbox.facturi@company.ro (your actual address).Inbox.Yes.Yes (reduces noise).Any.This trigger fires whenever a new email with attachments hits the shared inbox.
You don’t want to archive every attachment; only e-Factura XMLs.
Common patterns for e-Factura messages:
e-Factura.We’ll filter based on subject and XML attachments.
Subject (from the trigger).contains.e-Factura.This is a simple first filter. If your suppliers use different wording, adjust the condition to match your reality.
Under the If yes branch, we’ll process attachments. Under If no, we do nothing.
In the If yes branch:
Inside the Apply to each, you now have one context per attachment, with properties like Name and ContentBytes.
Inside the Apply to each:
Name (attachment name).ends with..xml.Under If yes, we’ll save the file. Under If no, we skip the attachment (e.g. PDF, ZIP).
We’ll use:
{ReceivedDate:yyyyMMddHHmmss}_{MessageId}_{OriginalFileName}.xml
The values we need:
ReceivedDateTime from the email trigger.MessageId from the email trigger.Name from the attachment.Power Automate expressions let us format the date and concatenate strings.
In a text field, click Expression and use:
formatDateTime(triggerOutputs()?['body/receivedDateTime'], 'yyyyMMddHHmmss')
This returns a sortable timestamp like 20261031153042.
Message ID can contain characters not ideal for file names. A simple approach is to remove angle brackets and @.
Add a Compose action before the XML condition (still inside the Apply to each), named Sanitized Message Id with this expression:
replace(replace(replace(triggerOutputs()?['body/messageId'], '<', ''), '>', ''), '@', '_')
This gives you a safer identifier.
Inside the If yes branch of the XML condition, add another Compose action named Final File Name:
concat(
formatDateTime(triggerOutputs()?['body/receivedDateTime'], 'yyyyMMddHHmmss'),
'_',
outputs('Sanitized Message Id'),
'_',
items('Apply_to_each')?['Name']
)
Note: Power Automate auto-generates names like Apply_to_each. Use the exact names from your flow or adjust the expression via the dynamic content picker to avoid typos.
Now we can create the file in SharePoint.
Inside the If yes branch of the XML condition:
https://tenant.sharepoint.com/sites/Finance)./e-Factura-Archive (pick from the browser UI).Final File Name compose.ContentBytes.This stores the XML exactly as received.
If suppliers resend the same invoice, you may want to avoid duplicate archives.
A simple deduplication approach:
Final File Name for the path.Because file existence checks require careful error handling (404 vs. other errors), a safer pattern is:
FileLeafRef equal to your target name.0, then create file; otherwise, skip.The exact OData filter depends on your library setup. For many teams, accepting duplicates is fine because the timestamp and message ID will differ.
You’re moving tax-relevant documents into your own archive. A few points matter:
The flow itself runs under the credentials of the owner or the connection reference used. Make sure the account has least-privilege access: shared mailbox and target library, nothing more.
Power Automate flows fail. For something as critical as your e-Factura archive, you want visibility.
Recommended additions:
On Error.On Error to run after the main scope on has failed, has timed out, or has skipped.On Error, send an email with the subject and message ID of the failed item.Some teams will eventually integrate directly with ANAF’s e-Factura API to pull invoices, not just email attachments. The pattern above still helps:
The key idea: whatever your upstream source (email, API, ERP export), Power Automate is the orchestrator that writes XMLs into a durable, queryable archive.
If ANAF deletes your e-Factura invoices after around 60 days, your archive must be more reliable than someone remembering to click “Download XML”. The practical move is to set up one Power Automate flow that:
Once this is in place and monitored, the “we can’t find the XML anymore” conversation disappears, and you regain control over your own invoice history.
This article reflects the shift from manual e-Factura downloads to automated, SharePoint-based archiving using Power Automate, particularly relevant for finance teams relying on shared mailboxes and needing reliable long-term invoice retention beyond ANAF’s portal limits.
Professionals who want to apply these patterns to their own data can explore Excelgoodies' Power Automate Course programme - taught live by instructors, with certification awarded once a real project is running at work.
Insights compiled through ongoing industry research and discussions within the Excelgoodies Analytics Community.
Power Automate
New
Next Batches Now Live
Power BI
SQL
Power Apps
Power Automate
Microsoft Fabrics
Azure Data Engineering