How To Automatically Convert Word Docs to PDF with Power Automate
Auto-Create Specific Number of Child Items When Parent Record is Created
In this Pragmatic Works video, Nate Halliwell, Senior Trainer at Pragmatic Works, demonstrates how to automate the creation of a specific number of child records when a parent record is created using Power Automate. The method involves using a "Do Until" loop to generate child records based on the quantity inputted for the parent record. This technique saves time and ensures consistency when handling large quantities of child records.
Overview of the Setup
Nate walks us through a simple scenario with two tables: **Asset** (the parent table) and **Asset Items** (the child table). The goal is to automatically create child records when a parent asset is added, avoiding the need for manual entry.
- Parent Table: Asset (e.g., laptops)
- Child Table: Asset Items (individual items related to each asset)
Without Power Automate, users would have to manually create each child record, which can be time-consuming, especially when dealing with a large number of assets. Power Automate simplifies this process by automatically creating the correct number of child records based on the quantity entered for each parent asset.
Creating the Automation Flow
To automate this process, Nate demonstrates how to build a flow in Power Automate. The flow triggers when a new record is added to the parent table (Asset) and automatically creates the corresponding number of child records in the Asset Items table.
Steps to Build the Flow
- Trigger Event: The flow is triggered when a new parent record is added to the Asset table.
- Creating Child Records with a "Do Until" Loop: A "Do Until" loop is used to create a specified number of child records. This number is based on the quantity field in the parent asset record.
- Initializing the Counter Variable: A counter variable (e.g.,
VAR counter) is initialized to track the number of child records created. It starts at 0 and is incremented each time a new record is added. - Adding Child Records: Inside the "Do Until" loop, a new row is added to the Asset Items table, linking it to the parent asset. The lookup field in the child record ties it to the parent asset using the parent asset's unique identifier.
- Incrementing the Counter: After each child record is created, the counter is incremented by 1. The loop continues until the counter equals the specified quantity for the parent record.
- Stopping the Loop: The loop stops once the counter matches the quantity input for the parent asset, ensuring that the correct number of child records are created.
Example Walkthrough
For instance, if a new asset record for 22 Lenovo Legion laptops is created, the flow will automatically generate 22 corresponding child records in the Asset Items table. The process is tested, and the expected number of child records appears after the flow runs successfully. The quantity input in the parent record determines how many child records are created.
Important Considerations
- Auto Numbering: The "Item Number" field in the child table is set to auto-generate, eliminating the need for manual input of item numbers for each child record.
- Lookup Columns: The child records are linked to the parent asset using a lookup column that references the parent asset’s unique identifier.
- Conditional Triggering: You can modify the flow to trigger only when certain conditions are met, such as when the parent asset is approved.
Conclusion
Nate Halliwell’s tutorial on automating the creation of child records using Power Automate is a highly practical solution for businesses looking to streamline their workflows. By using the "Do Until" loop, organizations can save time and ensure that all child records are correctly linked to their respective parent records.
If you found this video helpful and want to learn more automation techniques, consider subscribing to Pragmatic Works for more insightful tutorials!
Don't forget to check out the Pragmatic Works' on-demand learning platform for more insightful content and training sessions on Power Automate and other Microsoft applications. Be sure to subscribe to the Pragmatic Works YouTube channel to stay up-to-date on the latest tips and tricks.
Sign-up now and get instant access
ABOUT THE AUTHOR
Nate Halliwell is a Power Platform enthusiast, specializing in Power Apps and Power Automate. He began his journey into the Power Platform as a “Citizen Developer” while working as a recruiter in talent acquisition. He used Pragmatic Works to train himself on the technology and hopes to use this new role as a trainer to help others achieve similar career transitions! Nate is PL-900 and PL-100 Certified, and ready to help you take on any Power Apps or Power Automate challenges you or your organization are currently facing! Outside of work, Nate is a husband, a father to 2 boys, and a beer league hockey player.
Free Community Plan
On-demand learning
Most Recent
private training

Leave a comment