Forum Discussion

PWA_Service's avatar
PWA_Service
Copper Contributor
Jun 17, 2022

PWA OData-SP List [Power Automate Syncing issue]

Greetings,

 

If this belongs in the Power Automate forum, please do let me know, and I will delete this and repost it there. This is Power Auto focused, but considering that PWA/Project Online is the crucial data source, I felt this was the more appropriate place to post this. 

 

I need help with a Flow solution!!! [I am not looking for someone else to build it, but would definitely appreciate suggestions on methods that would likely get me towards a solution!]

 

Background of the Issue

When a new Project is created:

  1. An Azure Logic App runs, which primarily creates a Team, and creates a new item in a List (PWA2Teams) mainly from PWA O-Data.
  2. PWA2Teams captures basics such as: ProjectID, ProjectName, ProjectOwner, ProjectStatus, TeamsID
  3. There is also a multi-person Approval Flow which looks at PWA2Teams to auto-populate the Project Manager/Owner as one of the Approvers on the Flow.

 

The main issue is that on 2-5 projects, per week, in PWA, the Project Owner/Manager is changed to a different PM… which creates (2) main issues:

  1. The Owner/PM field in PWA2Teams list becomes out of sync with PWA Data, causing issues with other processes.
  2. The previous PM/Owner remains the 'Owner' of the Teams Team, but the new PM/Owner isn't automatically added.

 

If I can find a solution for the first issue, I can easily solve the second. However, I've tried every that has previously worked for comparing 2 Sharepoint Lists, finding differences, and applying the updates to the correct. I am not sure if my road block is comparing PWA O-Data with a Sharepoint List… or if it has something to do with Person/Group field / Claims / ID / Get User Profile… or a mixture.

 

Basics of the Flow:

 

This Flow will run twice daily on a recurrence. It will send HTTP Request to PWA & Sharepoint List. It will find matching items. It will compare them. It will update the Sharepoint Lists for items that have been updated in PWA.

 

Note: I JUST added a new column to the SP list, called ProjectManagerName, which is a Single Text, rather than a Person/Group… not sure if this might help as return to trying to find a solution. [I have not tried any possible solution with this new field in place.]

 

Screenshot of the List for reference...

 

I am getting data from both sources using:

 

PWA - HTTP Request

_api/ProjectData/Projects()?$Select=ProjectName,ProjectID,ProjectOwnerID,ProjectOwnerName,ProjectStatus&$Filter=ProjectType eq Kilgore Project

 

PWA2Teams - HTTP Request

_api/web/lists/GetByTitle('PWA2Teams')/items$select=Title,ProjectID,ProjectStatus,ProjectManagerPerson,ProjectManagerName,ProjectManagerID

 

Both of the parse JSON's work fine, which gives me the clean data-points that I need…

 

But this is where I have tried every method I know, to no avail. What sort of strategy should I be look for to:

  1. Find the Matches between both Sources.
  2. Compare the Project Owner between both Sources.
  3. Update the Owner in the PWA2Teams List when a difference is found in the PWA Odata.

[It would be nice to compare & update the ProjectStatus as well. #NeedNotRequired]

 

Strategies?

Am I looking at arrays?

Initializing variables and passing them along in different ways?

POST, IF-Match*, Merge?

validateUpdateListItem?

Convert the PWA 'ProjectOwnerName' via 'Get User Profile V2'?

All of them above and more?

 

Fingers crossed! Appreciate your time if you made it this far!

 

-TR

 

 

 

 

1 Reply

  • PWA_Service's avatar
    PWA_Service
    Copper Contributor
    @PWMather

    I just ran across an older post of yours... is this possibly a part of the solution I am looking for?

    https://social.technet.microsoft.com/Forums/en-US/0c40bb8d-4882-44b0-9f57-6e728698c08b/wer-using-o365-i-write-rest-api-for-getting-owner-email-but-still-i-am-not-get-email?forum=projectonline

Resources