Project workflows: How the "Send an HTTP request to SharePoint" connector can help you

%3CLINGO-SUB%20id%3D%22lingo-sub-217812%22%20slang%3D%22en-US%22%3EProject%20workflows%3A%20How%20the%20%22Send%20an%20HTTP%20request%20to%20SharePoint%22%20connector%20can%20help%20you%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-217812%22%20slang%3D%22en-US%22%3E%3CP%3EAzure%20Logic%20Apps%20and%20Flow%20feature%20a%20%22Send%20an%20HTTP%20request%20to%20SharePoint%22%20connector.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20style%3D%22width%3A%20636px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F38046i49BE24D27BF1A6A4%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22SharePoinTHTTPRequest.png%22%20title%3D%22SharePoinTHTTPRequest.png%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESharePoint%20HTTP%20connector%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20helps%20a%20lot%20as%20it%20does%20the%20authentication%20against%20SharePoint%20for%20you%20and%20allows%20you%20to%20use%20the%20full%20REST%20API%26nbsp%3B%20of%20Project%20Online.%3C%2FP%3E%3CP%3EThe%20current%20Project%20Online%20connectors%20are%20limited%20and%20after%20two%20years%20still%20in%20preview.%20So%20with%20the%20HTTP%20connector%20you%20will%20have%20a%20lot%20of%20new%20possibilities%20to%20manipulate%20Project%20Online%20without%20writing%20too%20much%20code.%3C%2FP%3E%3CP%3EAn%20intro%20to%20basic%20REST%20operations%20on%20Project%20Online%20can%20be%20found%20here%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FOfficeDev%2FProject-REST-Basic-Operations%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FOfficeDev%2FProject-REST-Basic-Operations%3C%2FA%3E%3C%2FP%3E%3CP%3ELink%20to%20the%20REST%20API%20documentation%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Foffice%2Fjj712612.aspx%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Foffice%2Fjj712612.aspx%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAn%20example%20on%20how%20to%20change%20the%20project%20description%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20637px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F38048i28A9B0E174EBF252%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22ChangeProjectDescription.png%22%20title%3D%22ChangeProjectDescription.png%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EChange%20project%20description%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHave%20fun%20building%20your%20workflows!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-485023%22%20slang%3D%22en-US%22%3ERe%3A%20Project%20workflows%3A%20How%20the%20%22Send%20an%20HTTP%20request%20to%20SharePoint%22%20connector%20can%20help%20you%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-485023%22%20slang%3D%22en-US%22%3E%3CP%3ETo%20update%20a%20project%20custom%20field%20you%20can%20use%20a%20similar%20REST%20endpoint%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20611px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F110591i7DD9A150613E2F23%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22UpdateCustomField.png%22%20title%3D%22UpdateCustomField.png%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EUpdate%20custom%20field%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDont%20forget%20to%20check%20out%20you%20project%20before%20and%20check%20it%20in%20later%20on%3A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20612px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F110590iD89B542D7AB11D7F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22CheckoutProject.png%22%20title%3D%22CheckoutProject.png%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ECheckout%20Project%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20609px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F110589i38589D0A5684403A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22PublishProject.png%22%20title%3D%22PublishProject.png%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EPublish%20project%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1851438%22%20slang%3D%22en-US%22%3ERe%3A%20Project%20workflows%3A%20How%20the%20%22Send%20an%20HTTP%20request%20to%20SharePoint%22%20connector%20can%20help%20you%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1851438%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F2087%22%20target%3D%22_blank%22%3E%40Trutz%20Stephani%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3EI'm%20trying%20to%20do%20something%20so%20simple%2C%20and%20it%20is%20driving%20me%20crazy%20that%20I%20can't%20figure%20it%20out.%20All%20I%20want%20to%20do%20is%20use%20an%20HTTP%20Request%20to%20SharePoint%20to%20get%20the%20value%20of%20a%20Custom%20Field%20on%20a%20specific%20project%20in%20Project%20Online.%20Using%20your%20example%2C%20I'm%20able%20to%20GET%20all%20the%20regular%20information%20on%20a%20specific%20project%20(using%20the%20GUID)%2C%20but%20how%20do%20you%20get%20to%20the%20custom%20fields%3F%20Any%20pointers%20you%20can%20share%20would%20be%20greatly%20appreciated!%3C%2FP%3E%0A%3CP%3EThanks%20kindly%2C%3C%2FP%3E%0A%3CP%3ELeland%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1851984%22%20slang%3D%22en-US%22%3ERe%3A%20Project%20workflows%3A%20How%20the%20%22Send%20an%20HTTP%20request%20to%20SharePoint%22%20connector%20can%20help%20you%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1851984%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F856634%22%20target%3D%22_blank%22%3E%40Doc0014%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt's%20probably%20easier%20to%20retrieve%20custom%20field%20values%20using%20the%20OData%20endpoint%20%3CPWA-URL%3E%2F_api%2FProjectData%2C%20e.g.%26nbsp%3B%3CPWA-URL%3E%2F_api%2FProjectData%2FProjects%20for%20project%20custom%20fields.%20This%20will%20provide%20the%20published%20values%20except%20for%20multiline%20text%20fields%2C%20the%20HTML%20formatting%20will%20be%20stripped.%3C%2FPWA-URL%3E%3C%2FPWA-URL%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUsing%20the%20REST-Endpoint%20you%20should%20use%20the%20following%20URL%3A%20%3CPWA%20url%3D%22%22%3E%3CSPAN%3E%2F_api%2FProjectServer%2FProjects(%E2%80%98%3CPROJECT%20guid%3D%22%22%3E%3C%2FPROJECT%3E%3C%2FSPAN%3E%3CSPAN%3E%E2%80%98)%2FIncludeCustomFields%3C%2FSPAN%3E%3C%2FPWA%3E%3C%2FP%3E%3CP%3EThis%20will%20bring%20the%20custom%20fields%20labelled%20by%20their%20internal%20id%20and%20for%20multiline%20text%20fields%20including%20the%20HTML-Formatting.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1853947%22%20slang%3D%22en-US%22%3ERe%3A%20Project%20workflows%3A%20How%20the%20%22Send%20an%20HTTP%20request%20to%20SharePoint%22%20connector%20can%20help%20you%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1853947%22%20slang%3D%22en-US%22%3E%3CP%3EFirst%2C%20thanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F2087%22%20target%3D%22_blank%22%3E%40Trutz%20Stephani%3C%2FA%3E%26nbsp%3Bfor%20the%20first%20posting%20and%20for%20replying.%20Your%20initial%20post%20was%20HUGELY%20helpful.%3C%2FP%3E%0A%3CP%3EWhile%20waiting%20for%20your%20response%2C%20I%20ran%20across%20some%20other%20articles%20that%20were%20no%20where%20near%20as%20well%20written%20as%20yours%2C%20but%20had%20elements%20of%20the%20same%20answer%20you%20gave.%20I%20ended%20up%20finding%20that%20if%20you%20call%20...%2F_api%2Fprojectdata%2FProjects(guid'projectID')%20-%20that%20will%20return%20all%20the%20fields%20with%20the%20names%20you%20can%20use.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EInteresting%20enough%20-%20if%20I%20tried%20to%20get%20that%20name%20via%20_api%2Fprojectserver%20route%2C%20it%20came%20back%20with%20an%20internal%20name%20like%20%22Custom_xxxxxx....%22%2C%20which%20didn't%20work%3B%20an%20Id%20that%20was%20a%20Guid%2C%20which%20didn't%20work%3B%20and%20the%20friendly%20name%20(in%20this%20case%20%22Landing%20Lead%22)%2C%20which%20of%20course%20didn't%20work.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBut%20when%20I%20went%20via%20_api%2Fprojectdata%20it%20showed%20the%20name%20as%20%22LandingLead%22%20which%20worked%20perfectly.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThought%20I%20would%20post%20this%20here%20in%20case%20others%20encounter%20the%20same%20thing.%20Hopefully%2C%20it%20makes%20there%20search%20easier%20and%20faster.%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Frequent Contributor

Azure Logic Apps and Flow feature a "Send an HTTP request to SharePoint" connector.SharePoint HTTP connectorSharePoint HTTP connector

 

This helps a lot as it does the authentication against SharePoint for you and allows you to use the full REST API  of Project Online.

The current Project Online connectors are limited and after two years still in preview. So with the HTTP connector you will have a lot of new possibilities to manipulate Project Online without writing too much code.

An intro to basic REST operations on Project Online can be found here:

https://github.com/OfficeDev/Project-REST-Basic-Operations

Link to the REST API documentation:

https://msdn.microsoft.com/en-us/library/office/jj712612.aspx

 

An example on how to change the project description:

Change project descriptionChange project description

 

Have fun building your workflows!

4 Replies
Highlighted

To update a project custom field you can use a similar REST endpoint:

Update custom fieldUpdate custom field

 

Dont forget to check out you project before and check it in later on:Checkout ProjectCheckout ProjectPublish projectPublish project

Highlighted

Hi @Trutz Stephani ,

I'm trying to do something so simple, and it is driving me crazy that I can't figure it out. All I want to do is use an HTTP Request to SharePoint to get the value of a Custom Field on a specific project in Project Online. Using your example, I'm able to GET all the regular information on a specific project (using the GUID), but how do you get to the custom fields? Any pointers you can share would be greatly appreciated!

Thanks kindly,

Leland

Highlighted

Hi @Doc0014 

It's probably easier to retrieve custom field values using the OData endpoint <PWA-URL>/_api/ProjectData, e.g. <PWA-URL>/_api/ProjectData/Projects for project custom fields. This will provide the published values except for multiline text fields, the HTML formatting will be stripped.

 

Using the REST-Endpoint you should use the following URL: <PWA URL>/_api/ProjectServer/Projects(‘<Project GUID>‘)/IncludeCustomFields

This will bring the custom fields labelled by their internal id and for multiline text fields including the HTML-Formatting.

Highlighted

First, thanks @Trutz Stephani for the first posting and for replying. Your initial post was HUGELY helpful.

While waiting for your response, I ran across some other articles that were no where near as well written as yours, but had elements of the same answer you gave. I ended up finding that if you call .../_api/projectdata/Projects(guid'projectID') - that will return all the fields with the names you can use. 

 

Interesting enough - if I tried to get that name via _api/projectserver route, it came back with an internal name like "Custom_xxxxxx....", which didn't work; an Id that was a Guid, which didn't work; and the friendly name (in this case "Landing Lead"), which of course didn't work. 

But when I went via _api/projectdata it showed the name as "LandingLead" which worked perfectly. 

 

Thought I would post this here in case others encounter the same thing. Hopefully, it makes there search easier and faster. :)