Expand my Community achievements bar.

How do I find the table name of a custom form through the API?

Avatar

Level 3

I am working with another team to get some base development to connect custom fields on a custom form in Workfront to similar fields on ServiceNow. After a fair bit of trial and error, I was able to get the custom field names, but I am being asked by our internal dev lead what the table name is for the fields that I have found. 

 

To make it a bit clearer to understand, we have a request queue that is utilized at an enterprise level for a majority of projects. When we convert the request to a project, a custom form called Digital Run Development can be added with a specific template. So, once converted there are three sections on the Details section: Overview, Digital Run Development, and the enterprise custom form. I need to see the table name for the Digital Run Development. Because when I make a field name request for the custom fields, all I can see is the name and ID of the test project I created and I don't see anything that indicates the Digital Run Development custom form.

 

Custom Form from converted project that I want to see the table name for when I am in Postman:

 

Screenshot 2023-11-17 at 3.11.42 PM.png

 

 This is what I see when I look for this particular test project through Postman. The custom fields show, but I don't see a reference to the above custom form:

 

Screenshot 2023-11-17 at 3.00.48 PM.png

 

Thank you,

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

7 Replies

Avatar

Community Advisor

Technically the table name is whatever object the form is attached to (so PROJ if it's a project, OPTASK if it's an issue, or TASK if it's a task), but I don't think that's what they're really trying to find. You also won't see any reference to the custom form that is attached, unless you are specifically looking for it and pulling the categoryIDs field, but you can see the fields on the form contained in the parameterValues collection. Can you clarify what they're trying to achieve with that information?

Avatar

Level 3

We are trying to match fields from Workfront to their related fields in ServiceNow. At the moment our coworkers are required to fill out two forms for requests to our IT developer team. We want to minimize that as much as possible by having the ServiceNow API call specific fields from our Workfront custom form whenever they fill out our custom request form on Workfront. Hopefully that wasn't as confusing as it reads.

Avatar

Community Advisor

Makes perfect sense. Each issue in Workfront I am assuming will have a matching request in ServiceNow, and at that point it's just a matter of finding finding the paired objects, and then mapping the fields between the two. The easiest way to handle your mapping is to have a field in Workfront that stores the ServiceNow ID of the paired request, then it's just a matter of fetching the information based on that field being equal to the ServiceNow ID, and pulling in the fields.

Avatar

Level 3

So knowing the table name for the custom form that those fields live on wouldn't be an issue? I know it shouldn't for the custom fields, but for any fields that are OOB, I am guessing that might pose some problems.

Avatar

Community Advisor

No, what form the fields are on doesn't matter. The form is just a vehicle to apply fields to an object.

Avatar

Community Advisor

Hi there,

with custom form I think it's a bit tricky but you should be able to get all the custom form names with just 1 API call.

https://[].my.workfront.com/attask/api/v14.0/PROJ/search?projectID=63285db6003ce63cbf9b882eeb2012ab&fields=objectCategories:category:name

Output

{
    "data": [
        {
            "ID": "63285db6003ce63cbf9b882eeb2012ab",
            "name": "Project Name",
            "objCode": "PROJ",
            "objectCategories": [
                {
                    "ID": "6558d8ef003c2ba279a21934100a6b68",
                    "objCode": "OBJCAT",
                    "category": {
                        "ID": "5d52242000559f6fc6eed6ffcddd7dd0",
                        "name": "First custom form name",
                        "objCode": "CTGY"
                    }
                },
                {
                    "ID": "6558d8f4003c2bc82a389cfa0760e7fc",
                    "objCode": "OBJCAT",
                    "category": {
                        "ID": "5b83e3810503289b4354cfa19183c6d1",
                        "name": "Second Custom form name",
                        "objCode": "CTGY"
                    }
                }
            ]
        }
    ]
}

data is nested 2 levels down, but it should do the trick

Avatar

Level 3

So, I copied the call you posted at the start of your answer (filling in with my company URL and the proper custom form ID) and I get an error message that says I am not logged in from Postman. However, if I use the call that I posted at the top, Postman pulls the field data without issue. So, I'm assuming that this would only happen if I were logged in.