cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
joew72
Advocate I
Advocate I

Moving Fields from one Entity to Another

Hello there,

 

We've been using a model-driven app as a case management system and we're in the early stages of trialling it. We've noticed a problem in how we've built the data and want to reshuffle how this data is stored to make things a bit easier for the user. In short, we want to move data from fields in one entity and place these fields into another entity.

 

For example:

 

Entity 1 (Case File)

- Field 1 (Name)

- Field 2 (Address)

 

Entity 2 (Case File Plan)

- Field 1 (Date and Time)

- Field 2 (Description)

 

I want to move fields 1 and 2 from entity and place these in entity 1. Eventually, we will remove entity 2.

 

Is there a quick way to do this other than exporting all the data into excel and then importing later?

 

*EDIT* Sorry just to add we've already entered about 150 records into the system so it would be good not to have to go through each one individually! I know, bad practice...we're learning!

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @joew72 ,

Could you please share a bit more about your scenario?

Do you want to move the Field1 and Field2 value from Entity2 into the corresponding Field1 and Field2 field in Entity1?

 

Based on the needs that you mentioned, I afraid that Model-Driven app could not achieve your needs. As an alternative solution, I think the PowerApps Canvas app or Power Automate could achieve your needs.

 

1. Using PowerApps Canvas app

Create a Blank canvas app, then add your two Entities as data source within it. Then add a Button within your app screen, set the OnSelect property to following:

ForAll(
       Entity2,
       Patch(
             Entity1,
             Defaults(Entity1),
             {
                Field1: Entity2[@Field1],
                Field2: Entity2[@Field2]
             }
       )
)

when you click the above button, the data within the Field1 and Field2 field of your Entity would be synced into the Field1 and Field2 in Entity1.

 

2. Using Power Automate

On your side, please set up a Power Automate flow, then configure it as below:

1.JPG

then you need to fire above flow manually, then the data from the Field1 and Field2 in Entity2 would be synced into the Entity1.

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xida-msft
Community Support
Community Support

Hi @joew72 ,

Could you please share a bit more about your scenario?

Do you want to move the Field1 and Field2 value from Entity2 into the corresponding Field1 and Field2 field in Entity1?

 

Based on the needs that you mentioned, I afraid that Model-Driven app could not achieve your needs. As an alternative solution, I think the PowerApps Canvas app or Power Automate could achieve your needs.

 

1. Using PowerApps Canvas app

Create a Blank canvas app, then add your two Entities as data source within it. Then add a Button within your app screen, set the OnSelect property to following:

ForAll(
       Entity2,
       Patch(
             Entity1,
             Defaults(Entity1),
             {
                Field1: Entity2[@Field1],
                Field2: Entity2[@Field2]
             }
       )
)

when you click the above button, the data within the Field1 and Field2 field of your Entity would be synced into the Field1 and Field2 in Entity1.

 

2. Using Power Automate

On your side, please set up a Power Automate flow, then configure it as below:

1.JPG

then you need to fire above flow manually, then the data from the Field1 and Field2 in Entity2 would be synced into the Entity1.

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for this response! This has solved my problem!

 

I used your suggestion using Power Automate.

 

Just for further clarification, what I was wanting to do was basically move all the data from Entity 2 into Entity 1 - not to correspond but rather to basically just have the data stored under Entity 1 rather than Entity 2. Users did not like having to open up a new form to find information which perhaps should have been originally put under entity 1 rather than in an additional entity (entity 2).

 

To do this, I created the fields in entity 2 and put them into entity 1. And then instead of using CREATE A NEW RECORD on Power Automate, I used UPDATE A RECORD. 

 

Thank you - this has saved me a lot of time!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,746)