Getting Custom Field values for Project, how to (On Prem, Web API, C#)
I’ve gone through the Custom Field docs that I can access from projectinsight.net and still can’t see how to get to the Custom Field values for a given project. And I am talking about the menu tree Customization, User Defined Fields, Project where we have a Field Name Project Phase that is backed by a DDL.
What I am trying to do is via Get Project.Active set the Model Properties so that I get the current value for Project Phase for each of the Projects listed. At this point, I don’t get it…
*** To be more specific, the part I don't get is when the Custom Field is a DDL. Then the respective Custom Field value in a query comes back as a Guid. Where do I go to get the value associated with that Guid? ***
If you could please point me in the right direction it would be appreciated.
-
Hello Gary,
You can specify the 'Type' of objects you want returned in the model properties. So, in your example, you can do a 'Get' method for active projects like this:/api/project/active/modelproperties=CustomFieldValue:CustomField7;CustomFieldValue,Name
What you will need to know is the CustomField number for "Project Phase". In my example, CustomField7 is a text field and the values are returned as string.
Here is the documentation to understand how to use and look up Custom Field properties and how you would know the "Field Number"
https://www.projectinsight.net/api/custom-fields
Hope this helps!
Thanks,
Robert0 -
Robert,
Thank you for your the effort.
The case I mentioned was a Custom Field that is a DDL (what developers call a Drop Down List). So I went back to the documentation link you provided for Custom Fields and re-read it one more time. Then I went on to the link at the bottom for Retrieve Custom Field Items and re-read it. Wow, I missed the link in the middle of the page for "reference the model" (listitem) here. However, .... this is what I got:
So no go there....
Thanks,G
0 -
Part 2: When I go into the C# API REST Client Tester, CustomField.Get, using the Guid from the Custom Field Definition - Proejct, Advanced tab, invoking the method returns the list the documentation describes. But I can't find a Model Properties definition for ListItem or ListItems or anything similar that makes sense to me.
Trying model properties values using ListItem:all; or ListItems:all does not return all of the fields for ListItems of CustomField. What I'm looking for is the IsActive field.
What am I missing?
Thanks,
G
0 -
Hello Gary,
We will fix the documentation to load the ListItemValue model correctly. In the mean time, I created a screenshot to show you the properties for the ListItemValue object.
You will be able to now retrieve the ListItemValue information from the specific CustomItem and then program as necessary.
Hope this helps you progress further in your integration.
Please let us know if there is anything else we can help with!
Thank you,
Robert
0 -
Hello Gary,
This bug will be fixed in the next build, so that the "ListItems" property will display both the "Order" and "IsDefault" property correctly.
Thank you,
Robert
0 -
Robert,
Has this been fixed? If so, what build so I can notify Brent on this end to watch for it.
Thanks,
G
0 -
Hello Gary,
This fix was introduced in version 18.7.0.2. We recommend installing version 18.7.0.3, but it will ready within a week or two.
Please verify with our support team.Thank you,
Robert
0 -
Hello Gary & Robert,
Thanks for the above
This post helped me to retrieve custom field values on project via the API's
I am looking at updating a custom field using the POST method of Projects by passing in the specific Project ID.
I am able to update other system defined fields like "Name", I am trying to update the CustomField but this is not updating the data.
e.g. of the array that i am passing to update the Fields are
array("CustomeFieldValue:CustomField2;CustomeFieldValue"=>"Mario summary","Name"=>"Marios Test Project","Id"=>"e4035f06-a5d2-4339-981c-1f089e653395");
The first paramater is the CustomField2 i am trying to update. I have tried using the following options as well
CustomField2
CustomFieldValue:CustomeField2
The field "Name" does get updated
I have also added this as a separate post just so that it is open to community with the appropriate Title.
Thanks
Mario
0
Please sign in to leave a comment.
Comments
8 comments