Skip to main content

Notifications

Power Automate - Building Flows
Suggested answer

Project for the Web - Dataverse List rows - Project Tasks

(0) ShareShare
ReportReport
Posted on by 31
Hi all,
 
I've been able to successfully create project tasks using power automate from a form input and assign the task to someone in my team.
 
What I'm trying to do now is to retrieve  all tasks from a give project and collect the email address of the assigned persons to email them the tasks they are assigned.
 
But from the info I get from the Dataverse List Rows when doing an ODATA filter on the specific project, I can't find anything that links the task to a person.  There is an OwnerID but I think that's always me as the project manager, there is also details of who last modified the task but that's not always the person assigned to the task.
 
Any guidance would be greatly received. :)
  • Suggested answer
    rzaneti Profile Picture
    rzaneti 3,365 on at
    Project for the Web - Dataverse List rows - Project Tasks
     
    Sorry for the late response. I ran a few tests from my end to check how exactly this path would look like. See the step-by-step below and let me know if something is not clear enough :)
     
    I created this task for testing purposes, which is assigned to a user called "Flows Test" (which is actually a shared mailbox, but contains a related record in systemusers table):
     
     
    I used this flow to navigate from the task until the user data:
     
     
    For the List rows - Tasks, I'm retrieving all records from Project Tasks table, filtered by name. I just took the name to keep things simple, but you can use the project name and project bucket, as you mentioned in the previous message. Based on your description, you were able to access the project tasks in Power Automate, so this part of the process is not new:
     
    Now let's access the Resource Assignments table, filtering the records by project task. For it, you will need to use the _msdyn_taskid_value in the Filter rows input (in green), to use a lookup reference to the msdyn_taskid column (the logical name of Project Task column in the Resource Assignments table). Still in the filter query, you must check if this property is equal to the msdyn_projecttaskid property retrieved by List rows-  tasks, which corresponds to its GUID (in blue). Since I'm working with a single record, I hardcoded the array reference with the zero ([0]), but you could also implement this logic within an Apply to each to access the assigned users for many tasks:    
     
     
    In the image above there is also a Expanded Query (in red) referencing the Bookable Resource column (msdyn_bookableresourceid). This is a important step to avoid making an extra List rows in this flow. the expanded query basically retrieves the properties from a related record in another table (in this case, Bookable Resources), when you have a many-to-one relationship. As a consequence, Power Automate will retrieve all data from the record in the Resource Assignment table, and the data from the related Bookable Resource.
     
     
    Now let's finally access the user properties. You can use a Get a row by ID action for it, since we have the user ID from the Bookable Resource data. Pass the expression outputs('List_rows_-_Resource_assignment')?['body/value'][0]['msdyn_bookableresourceid']['_userid_value'] as input, which corresponds to the user ID recorded in the Bookable Resource data (and retrieved in our Resource Assignment due to the expanded query):
     
    At the end, I added a Compose just to print the values of the user full name and its email address. After running the flow, this is the output
     
     
    Let me know if it works for you or if you need any additional help!


    -------------------------------------------------------------------------
    If this is the answer for your question, please mark the post as Accepted Answer.
    If this answer helps you in any way, please give it a like.

    http://digitalmill.net/
    https://www.linkedin.com/in/raphael-haus-zaneti/
     
  • Displaced_2000 Profile Picture
    Displaced_2000 31 on at
    Project for the Web - Dataverse List rows - Project Tasks
    @rzaneti thank you for your reply below and the description of the data model has steered me in a good direction. 
     
    What I'm having issues with is knowing the unique identifiers between the elements in the model.  
     
    I'm using _msdyn_project_value to filter the Project Tasks table, I'm also filtering using _msdyn_projectbucket_value to only return tasks in certain buckets.
     
    From those tasks I'm using select to retrieve the OwnerID, Project Bucket and Task Name
     
    But what value/element would get me to the Resource Assignment > Bookable Resource > User etc
     
    Many Thanks
  • abm abm Profile Picture
    abm abm 32,275 on at
    Project for the Web - Dataverse List rows - Project Tasks
    Hi
     
    Believe by default when the record is created default owner id is the person who created. Could you post a screenshot of your mappings?
     
    Thanks
  • Suggested answer
    rzaneti Profile Picture
    rzaneti 3,365 on at
    Project for the Web - Dataverse List rows - Project Tasks
    Hi,
     
    The data model for the Project for the web is tricky. The relationship between users and project tasks is managed by the Resource Assignment table, which contains a lookup field for the Project Task and another for the Bookable Resources tables.
     
    If you just need the assigned user name, then you are good by just reading the Project Task table, since you can access the lookup label from it. But if you need their unique id, then you will need to access the Bookable Resources table, where you can find the related systemusers table record.
     
    In summary, the data model looks like this:
     
     
    Project -< Task -< Resource Assignment >-Bookable Resources - Users
     
    Let me know if it works for you or if you need any additional help!


    -------------------------------------------------------------------------
    If this is the answer for your question, please mark the post as Accepted Answer.
    If this answer helps you in any way, please give it a like.

    http://digitalmill.net/
    https://www.linkedin.com/in/raphael-haus-zaneti/
     
     
     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard