Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Answered

automatic create a record based on some conditions in the model driven

(0) ShareShare
ReportReport
Posted on by 26

Hello everyone,

I have an application contains on two entities ... what I need to do is when some conditions have done automatically create a new record in the another entity and take some data from the original entity ... is there any way to do it?

hope I explained the issue well .. thanks in advance

Categories:
  • MohammedWard Profile Picture
    26 on at
    Re: automatic create a record based on some conditions in the model driven

    yes, that what I did  ... Thanks

  • Joel CustomerEffective Profile Picture
    3,224 on at
    Re: automatic create a record based on some conditions in the model driven

    great to hear @MohammedWard . 

  • MohammedWard Profile Picture
    26 on at
    Re: automatic create a record based on some conditions in the model driven

    @jlindstrom  Thanks very much it's working

  • MohammedWard Profile Picture
    26 on at
    Re: automatic create a record based on some conditions in the model driven

    Thanks  

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at
    Re: automatic create a record based on some conditions in the model driven

    @jlindstrom 

    Of course you are right.  I overlooked the model driven reference. 

  • Verified answer
    Joel CustomerEffective Profile Picture
    3,224 on at
    Re: automatic create a record based on some conditions in the model driven

    @Drrickryp  your solution is awesome but I think the question is regarding model driven apps.

     

    There are two ways to do that in a model driven app @Drrickryp . Real time workflow or Power Automate. 

     

    for Power automate Flow:

     

    create a solution

    add a flow to the solution

    choose common data service current environment connector

    select for trigger when a record is created, updated, or deleted. set it to the entity 1 and choose the when a record is created option.

    next step get records--get the record that triggered the flow. You want to do this because on create doesn't return all of the fields..

    then add a create step  choose entity 2 for the entity type, then map the desired fields.

    populate the lookup for entity 1 on entity 2, but be sure you use the right format. https://crmtipoftheday.com/1311/use-entity-name-in-flow-lookups/

     

    for real time workflow, you will need to click the gear and go to advanced settings-->processes. 

    Create a workflow and uncheck the run in background option.

    Choose entity 1 as the entity type.

    trigger to run on organization scope and run when record is created

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/configure-workflow-steps#:~:text=Table%201%20%20%20%20Action%20%20,to%20create%20...%20%203%20more%20rows%20

     

    I prefer flow, unless it needs to happen immediately. then use real time workflow. don't use background workflow, it will go away in the future.

     

    @MohammedWard  if this answers your question please mark it as a solution.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at
    Re: automatic create a record based on some conditions in the model driven

    Hi @MohammedWard 

    If you are using an edit form in entity1 (say named Form1) to input the original data you could use Patch() in the OnSuccess property of the form in entity1 to add some items from entity1 to entity2 by putting the following formula in the OnSuccess property of the edit form:

     

    Patch(entity2, Defaults(entity2), {targetfield1:Form1.LastSubmit.aname, targetfield2:Form1.LastSubmit.address, etc.})

     

    This patch would execute immediately on submission of Form1, creating a record in entity2 and putting data from a field from entity1 called aname into a field in entity2 called targetfield1 and data from a field called address in entity1 into targetfield2 of entity2 . It would be important to have the Patch in the OnSuccess property because you would not want it to execute unless the submission to entity1 was successful.  Naturally, you would change the name of "targetfield1"  and "targetfield2" to the actual names of the fields in entity2. 

     

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Microsoft Dataverse

#1
mmbr1606 Profile Picture

mmbr1606 22 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 19

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 17 Super User 2025 Season 1

Overall leaderboard

Featured topics