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 Apps / Maintain Relationship ...
Power Apps
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. 

I have the same question (0)
  • _minnies_ Profile Picture
    91 on at

    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

  • mike_at_SE Profile Picture
    2 on at

    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

    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.

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard