web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / How to best generate s...
Power Pages
Answered

How to best generate seed data for a data store when a new entity is created?

(0) ShareShare
ReportReport
Posted on by 2
Hey,
 
I have a project where users will create a new entity in a Canvas Power apps.
 
As soon as they click create on the new entity I'd like to populate other entities with 'seed' data to support the underlying functionality of the system. Ideally a user would be able to customise this 'seed' data and then the system would understand when the entity is being created what customised seed data to insert.
 
To give an example, lets say I had a ecommerce Canvas Power app.  I allowed the users to create a store.  Each store has a list of supported currencies.  When they create the store I want to insert the supported currencies from their default configuration.  There are also 4 or 5 other entities which I'd like to insert their default store values into from their custom configuration customise.
 
Any ideas would be appreciated.
 
Thanks,
 
Categories:
I have the same question (0)
  • Verified answer
    SwatiSTW Profile Picture
    809 Super User 2026 Season 1 on at
    1. Create New Entity in Power Apps - Use a form or button to create a new entity.
    Use the Patch function to add a record:
    Set(newEntityID, Patch(Entity, Defaults(Entity), {Field1: Value1, Field2: Value2, ...}).ID)
    Store the new entity ID for further use.
    2. Trigger Power Automate Flow - Add a Power Automate button in Power Apps to trigger a flow
    'FlowName'.Run(newEntityID, User().Email)
    Pass the newEntityID and user email to the flow.
    3. Power Automate Flow Setup - Trigger - Use "PowerApps" trigger to start the flow.
    Use "Get Rows" (Dataverse) to fetch user-specific default configurations.
    Filter('DefaultConfigurations', UserID eq UserEmail && EntityType eq 'Store')
    For Insert Seed Data ,  Use "Create a new row" actions for each related entity:
    Add row to table: 'Currencies', StoreID = newEntityID, CurrencyCode = config.CurrencyCode
    4. Customize Seed Data in Power Apps - Create a screen to manage seed configurations.
    Use LookUp to display user-specific configurations:
    LookUp('DefaultConfigurations', UserID = User().Email && EntityType = "Store")
    Use the Patch function to update configurations:
    Patch('DefaultConfigurations', LookUp('DefaultConfigurations', ID = selectedConfigID), {Field: NewValue})
    5. Use IfError to handle errors during entity creation.
    IfError(Patch(Entity, ...), Notify("Error creating entity", NotificationType.Error))
    6. Deploy as Solution - Bundle Power Apps, Power Automate flow, and entities in a Power Platform solution

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 35 Super User 2026 Season 1

#2
Mohsin Ali Profile Picture

Mohsin Ali 25

#3
11manish Profile Picture

11manish 20 Super User 2026 Season 2

Last 30 days Overall leaderboard