Project Online: Workflow error when reading flag field

2018-02-11 | Barbara.Henhapl

In November 2017, a support article was published how to Troubleshoot Project Online workflows. One described error is “Custom field CUSTOM_FIELD_GUID does not have a value set for project PROJECT_GUID”. There is a special case when reading an Enterprise Custom Field of type Flag, as mentioned in a Note.
Flag fields have one special behavior: You can’t set a default value for this type of fields. The value is blank, until you changed it manually at least one time – even if it is displayed as No on Project Detail Page or in Project client. Therefore, you can’t access this value from within a SharePoint Designer workflow until the first change.

In this case, a workflow will display the following error:

Error text:

Retrying last request. Next attempt scheduled in less than one minute. Details of last request: HTTP BadRequest to https://………….',propertyId='….') Correlation Id: ….Instance Id: ….
Custom field …. does not have a value set for project….

On my request, a workaround was added as a note, what I see a option 1:

Option 1:


There is one drawback with this option: If you are working in multi language environments, a lookup table with yes/no, true/false, … will not satisfy your non-English users.

Option 2:

There is another option, however it requires some more effort within your workflow. The main part is to use REST API to evaluate, if a value is set for a specific field.

  1. Step 1 – Set Parameters/Variables
  2. Step 2 – Get internal name for Enterprise Custom Flag field
  3. Step 3 - Get ECF value for Project using REST and initialize if necessary

Step 1 – Set Parameters/Variables

We need two variables in this case:

  1. We need a variable to parameterize the name of the ECF of type Flag
    Use Action – Core Actions – Set Workflow Variable to set a new variable to your flag field name.In my sample, I named this variable v_ECFFlagName.
  2. We need the second variable as dictionary as Request Header for our REST call. I named my dictionary I want to use as Request Header v_RequestHeaderStandard (in future posts, you will see some different Request Headers and I want to be able to identify them)
    Use Action – Core Actions – Build Dictionary to build v_RequestHeaderStandard.

    To get the the response in a JSON format we will have to update the Accept and Content-Type http headers of our REST http call:
    Accept : application/json;odata=verbose
    Content-Type : application/json;odata=verbose
    Click on this to add Accept  and Content-Type and set value to application/json;odata=verbose for both names.

    Click on Variable: dictionary to define a variable with a meaningful name.

    In this sample, I use v_RequestHeaderStandard as mentioned above.

Afterwards, it will look like this:


Step 2 – Get internal name for Enterprise Custom Flag field

To get the internal name for your field, you can use https://<YourTenant>$Filter=Name eq '<YourFlagFieldName>'&$SELECT=InternalName.

After above steps, v_InternalName will be the internal name as required in the next step and it will look like this:


Step 3 - Get ECF value for Project using REST and initialize if necessary

To get the value of all available fields including custom fields, we have to use following URL: https://<YourTenant>'<ProjectId>')/IncludeCustomFields/IncludeCustomFields. To retrieve the value within the workflow, we will need another HTTP Call. For this call, we need a different URL and re-use the variable v_RestURL.

With the above actions, Step 3 will look like this:


Just a note at the end: The same applies for Project Server 2016 (and presumably for Project Server 2013 – but I have not tested with this version).

Categories: Project, SharePoint Designer Workflow