Practical Examples of Power Automate with Business Central
FREE Membership Required to View Full Content:
Joining MSDynamicsWorld.com gives you free, unlimited access to news, analysis, white papers, case studies, product brochures, and more. You can also receive periodic email newsletters with the latest relevant articles and content updates.
Learn more about us here
Business Central users often need to react when something happens in the system or update records based on activity that occurs outside of it. Doing this manually usually means exporting files, sending messages by hand, or re-entering data from external sources. Power Automate provides a way to connect these systems using standard connectors and business events, without requiring full custom development.
This session walks through two practical examples that show how Business Central events can trigger external actions and how external file activity can drive updates back into Business Central. The examples focus on real mechanics such as business events, system IDs, file handling, parsing logic, and troubleshooting, using Quality Inspector as a concrete reference point.
Chapters
- 0:00 — Intro + what you’ll learn (Power Automate + Business Central)
- 1:05 — Two core patterns (BC → outside world, outside world → BC)
- 4:08 — Scenario 1 overview: when a test finishes → PDF → OneDrive → Teams
- 5:37 — Build Scenario 1 flow: Business Central trigger + generate PDF
- 12:25 — Save PDF to OneDrive + create share link
- 19:30 — Post message to Teams + test run (run history + timing)
- 27:56 — Scenario 2 overview: file uploaded → parse → update test values in BC
- 32:50 — Build Scenario 2 flow: trigger + extract lot # + find test record
- 42:48 — Parse file with compose + loop + conditionals
- 53:06 — Write values back to Business Central (run action: set test value)
- 56:49 — Demo run + debugging a failure (run history, fix, re-test)
- 1:02:26 — Wrap-up + key takeaways
Session Overview
This session introduces practical Power Automate examples using Business Central, focused on demonstrating patterns rather than delivering a hands-on lab.
- Uses Quality Inspector as the working example, while keeping the techniques applicable to other Business Central scenarios
- Introduces the presenter and background in designing manufacturing-focused Business Central apps
- Frames automation around two core scenarios involving Business Central and external systems
- Explains that the session is a demonstration rather than a guided exercise
- Focuses on understanding how events and actions connect across systems
Skills and Tools Used
The session assumes a technical audience that understands Business Central concepts but does not require development-level skills.
- Requires basic understanding of Business Central records and processes
- Uses Power Automate as a low-code, drag-and-drop tool
- Relies on general logic concepts such as conditions and loops
- Uses Business Central, Microsoft Teams, Microsoft Power Automate, and OneDrive for Business
- Includes Quality Inspector as the example app used for demonstrations
Scenario 1: Business Central Event to External Notification
The first scenario covers cases where something happens inside Business Central and a notification or action needs to occur outside the system.
- Uses the completion of a quality inspection test as the triggering event
- Demonstrates reacting to Business Central business events
- Shows how to notify users outside Business Central
- Uses Teams as the messaging example, though other systems could be used
- Focuses on event-driven automation rather than scheduled polling
Creating the Flow Trigger
The flow begins by responding to a Business Central business event inside Power Automate.
- Creates an automated cloud flow in Power Automate
- Selects the Business Central trigger called “When a business event occurs”
- Chooses the appropriate environment and company
- Selects a specific business event related to quality inspection tests
- Uses the event context to provide all required identifiers for later steps
Generating the PDF from Business Central
After the trigger fires, the flow retrieves a PDF document directly from Business Central.
- Adds an action using the Business Central connector
- Selects the “Get an image, file, or document” action to stream file data
- Chooses the Quality Inspections API category
- Specifies the report path using the OData path for the quality inspection test report
- Passes the quality inspection test System ID from the event context into the action
The generated PDF is simply a report that displays the values collected during the quality inspection test that has been marked as finished.
Saving the PDF to OneDrive
Once the PDF is generated, the flow stores it in OneDrive for Business.
- Uses the OneDrive for Business connector with the “Create file” action
- Saves the file into a predefined output folder
- Builds the file name using concatenation functions
- Includes values from the event context such as test number, item number, and lot number
- Uses the output body from the Business Central action as the file content
Creating a Shareable Link
After the file is created, the flow generates a link that can be shared with others.
- Uses the OneDrive action “Create share link”
- Creates the link using the file’s unique identifier
- Avoids relying on file paths or regenerated names
- Creates a view-only share link
- Uses an anonymous link scope for the example
Posting the Notification in Microsoft Teams
The final step of the first scenario delivers the information to users in Teams.
- Uses the Microsoft Teams connector
- Posts the message as the Flow bot
- Targets a predefined team and channel
- Includes quality inspection details in the message
- Adds the OneDrive share link to the post
Run History and Timing Notes
The session highlights how Power Automate executes flows and how to monitor them.
- Flow execution is not immediate and may take seconds or minutes
- Business Central transactions do not wait for the flow to complete
- Flow execution is fire-and-forget
- Run history shows each step and how long it took
- Failed runs can be reviewed and tested again using recent triggers
Scenario 2: External File Upload to Business Central Update
The second scenario reverses the direction of automation, starting outside Business Central.
- Triggers when a file is uploaded to OneDrive
- Parses file content to extract measurement data
- Locates the matching quality inspection test in Business Central
- Updates test values based on the parsed data
- Focuses on flow logic rather than broad system integration
Goal and File Format
This example relies on a specific text file structure.
- File name represents the lot number
- File contains irrelevant header data
- Measurement lines begin with a defined prefix
- Measurement values are separated by semicolons
- Only selected lines are processed and applied
Trigger: File Created in OneDrive
The flow starts when a new file appears in a monitored OneDrive folder.
- Uses an automated OneDrive trigger
- Watches a specific input folder
- Uses file identifiers provided by the trigger
- Reduces polling interval for demonstration purposes
- Notes that polling frequency should be considered in real environments
Compose: Extract Lot Number from File Name
The first Compose action prepares the lot number for later use.
- Uses a Compose block to store a temporary value
- Removes the “.txt” extension from the file name
- Uses a replace function for the transformation
- Produces a clean lot number value
- Improves readability compared to inline expressions
Find the Matching Test in Business Central
The flow then locates the correct quality inspection test record.
- Uses the Business Central connector
- Calls “Find one record” in the Quality Inspection API category
- Filters records by source lot number
- Assumes one test per lot number for this example
- Retrieves the System ID needed for later updates
Get File Content from OneDrive
The flow retrieves the contents of the uploaded file.
- Uses the file identifier from the OneDrive trigger
- Avoids rebuilding file paths or names
- Retrieves raw text content
- Prepares the data for parsing
- Keeps the flow structure simple
Compose: Split File into Lines
The file content is then broken into individual lines.
- Uses a Compose block to split the content
- Splits based on line break characters
- Uses decodeUriComponent to represent the delimiter
- Produces an array of lines
- Prepares the data for looping
Apply to Each and Condition: Process Only Measurement Lines
The flow iterates through each line and filters relevant data.
- Uses an Apply to each loop over the array of lines
- Adds a Condition to check for the defined prefix
- Processes only lines that start with the expected value
- Skips header and irrelevant lines
- Limits processing to measurement data only
Compose: Split the Line by Semicolons
Relevant lines are further broken into parts.
- Uses a Compose block inside the loop
- Splits the line using semicolons
- Produces an array of values
- Enables indexed access to elements
- Prepares data for extraction
Compose: Extract Measurement Key and Value
The flow extracts the values needed for Business Central updates.
- Takes the measurement key from the first array element
- Removes underscores using a replace function
- Extracts the measurement value from a defined index
- Uses zero-based indexing
- Produces values aligned with Business Central field codes
Update Business Central: Run Action to Set Test Value
The extracted data is written back into Business Central.
- Uses the Business Central connector
- Calls “Run action” in the Quality Inspection API category
- Selects the action to set a test value
- Passes the System ID of the test record
- Supplies the measurement key and measurement value
Debugging the Flow with Run History
The session closes with a walkthrough of troubleshooting.
- Tests the flow by uploading a file to OneDrive
- Reviews run history to identify failures
- Inspects the specific loop iteration that failed
- Corrects a syntax issue in the Compose expression
- Reruns the flow using the test feature and verifies results in Business Central