Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Unanswered

Maintain Relationship for a given row when deleting and repopulating data

(0) ShareShare
ReportReport
Posted on by 2

Here is my situation:

 

Table A - Employees

All employee data, to include the unique employeeNum field, is deleted from the table each night and 'fresh' data is added back in via API.  So for example, the employee row for employeeNum = 13688 (John Smith) would be deleted and then a new row is added with employeeNum = 13688 (John Smith).

 

Table B - Assignments

This table has a many to one relationship with employees (an employee can have many assignments).  The assignments table is not deleted or purged like the employee data.  The relationship is between assignmentId and employeeNum.  

 

I am looking for guidance on how to establish the relationship between Employees and Assignments tables so that when the Employees data is deleted, and then added back in, the relationship between Assignments and Employees will be maintained. 


Thanks. 

  • _minnies_ Profile Picture
    91 on at
    Re: Maintain Relationship for a given row when deleting and repopulating data

    Hi @mike_at_SE 

    sorry for the late reply. In my opinion it would be better to focus on the original problem and to update existing items. I guess your employees have an unique employee id in your system. You could use a for each loop to iterate through all the elements and search for existing elements in the table. You could update these and if no element is found, you could create a new one. Depending on the number of employees, this may take a little longer, but if the workflow only runs once a day, it might still be possible.

  • mike_at_SE Profile Picture
    2 on at
    Re: Maintain Relationship for a given row when deleting and repopulating data

    We are getting the Employee data via API.  I was having problems being able to map through the existing rows to identify updated data in the source Employee data.  So my solution was to just import the entire table each night.  

  • _minnies_ Profile Picture
    91 on at
    Re: Maintain Relationship for a given row when deleting and repopulating data

    Hi @mike_at_SE 

    first it would be helpful to understand, why the table content is deleted every day. May there be another solution so you could keep the employees with their assignments?

     

    Best regards

    Jeanine

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

🌸 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…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Microsoft Dataverse

#1
mmbr1606 Profile Picture

mmbr1606 22 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 17

#3
ankit_singhal Profile Picture

ankit_singhal 11 Super User 2025 Season 1

Overall leaderboard

Featured topics