Forum Discussion
PWA O365: Accessing data in Custom data field using OData
In my MS Project file (Project Web App https://environmentnswgov.sharepoint.com/sites/space/Electricity[Program Name]/) I can read the list of custom fields using PowerBI ODataFeed. The PowerBI (PowerQuery) code is below:
Source = ODataFeed("https://environmentnswgov.sharepoint.com/sites/space/Electricity[Program Name]/Projects('[Project ID]')/Tasks('Task ID')/CustomFields", null, [Implementation="2.0"])
It returns table with the list of custom fields names, their properties and their AppAlternateIDs (whatever that means)
But I cannot find a way to read the values of those custom fields for the tasks. I have tried things like
Source = ODataFeed("https://environmentnswgov.sharepoint.com/sites/space/Electricity[Program Name]/Projects('[Project ID]')/Tasks('Task ID')/CustomFields('AppAlternateID')", null, [Implementation="2.0"])
But that simply returns the relevant row from the table I get in the previous step (without using the 'AppAlternateID' in the URI)
I have been googling it and many people are scratching their heads for an answer.
3 Replies
Hello Asim_H ,
For reporting, use the ProjectData API: https://[tenant].sharepoint.com/sites/space/[Program Name]/_api/ProjectData - you will see lots of tables / endpoints here.
Use the Projects table / endpoint to get Project level details: https://[tenant].sharepoint.com/sites/space/[Program Name]/_api/ProjectData/Projects
Use the Tasks table / endpoint to get Task level details: https://[tenant].sharepoint.com/sites/space/[Program Name]/_api/ProjectData/Tasks
Paul
- Asim_HCopper Contributor
Thanks Paul_Mather . I'm not sure what is the difference between the ProjectServer vs. ProjectData but I can't get the list of custom fields using the ProjectServer.
Anyway, I'm already using those end points that you mentioned. As noted in my original post, the issue is really with getting the values of custom fields linked to the Tasks (I..e added columns in the schedule). That's where some example or documentation of the ODATA for PWAs would be helpful.
Hello Asim_H ,
/ProjectServer is the CRUD API whereas the /ProjectData API is the read / reporting API. Are you just reading data or wanting to update it?
Paul