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