I have a list of vendors, Vendor Contacts, and I need to update their Agreement Status (Active/Expired/NA) based on another list, Contracts Tracker, that contain their Agreements/Contracts. A vendor will have multiple contracts on the contracts tracker at any given time.
Examples:
Vendor Contacts:
Vendor | Agreement Status |
---|---|
Vendor 1 | Active |
Vendor 2 | Expired |
Vendor 3 | NA |
Contracts Tracker:
Vendor | Contract Name | Agreement Status |
---|---|---|
Vendor 1 | Name 1 | Active |
Vendor 1 | Name 2 | Expired |
Vendor 2 | Name 1 | NA |
Vendor 2 | Name 2 | Expired |
Vendor 3 | Name 1 | NA |
I need to update the a vendor's status only after comparing the status of all of its contracts. The logic would be as follows:
For any vendor listed in the Vendor Contacts, if any contract is Active on the Contracts tracker, set the agreement status on the contacts list as Active. If there are no active contracts, but there are expired or NA contracts, then set the status to expired. If there are only NA contracts, then set the status to NA.
How would I accomplish this using Power Automate?
I've seen tutorials that compare single items on each list using an ID or name, but I don't know how to get the contracts for each vendor then do the comparison. I'm new to all of this so I'm not sure where to start.