FUSION: Searching for Projects missing a specific Project form (category). Or listing all project forms in Fusion. | Community
Skip to main content
RandyRoberts
Community Advisor
Community Advisor
November 20, 2021
Solved

FUSION: Searching for Projects missing a specific Project form (category). Or listing all project forms in Fusion.

  • November 20, 2021
  • 5 replies
  • 2680 views

Searching for Projects missing a specific Project form (category). Or listing all project forms in Fusion.

I'm creating an automation to add a specific project form to any project that doesn't already have it. I have a search module that searches all active projects and returns:

ID

Category ID

Name

Status

References:

Category

Collections:

objectCategories

Since projects can have more than one form, I included objectCategories from Collections.

In the return bundle, everything makes sense except the objectCategories. There are 2 and neither are the form listed in the CategoryID section. In fact, I can't find these IDs anywhere. What are they, where did they come from? None of my forms of any kind have these IDs.I went and looked at the project and it has 2 forms. The form IDs are: 58b6fe780027736f3c7dc222dc334979 and 5ed7c604024fe585b29e5894d8da05a9, neither of which are in the objectCategories section.

I created a project report with columns for name, Category ID, Category Name, objectCategories (ID), and objectCategories (category.name).

If the objectCategory references the form, why do the IDs NOT match? Should I reference the Category ID or the objectCategory ID?

For example:

Is the ID of "Project Form | Project" 5ed7c604024fe585b29e5894d8da05a9 as in the Category ID?

or is it 6102ee5c0004298052d658bf37d89a41 as in the objectCategories?

This is pretty confusing.

Best answer by AaronAb1

Hi Randy,

I struggled with this exact same thing trying to enforce a set of 3 custom forms onto every project. I am not sure from a search function, but from a READ RECORD object, show advanced settings, and for collections, click the slider to MAP and put in: objectCategories:category:*

this will get the ID of all of the custom forms attached to the project. If you use the automatically mapped collection, and not manually mapping it, near as I can tell you get an ID for some type of connection record, that links the project to the custom form, not the ID of the custom form itself.

Once you have done this, you need to create a variable using a SET VARIABLE object to contain the array of form IDs. Name your variable, I have lifetime set to one cycle, then for the value, use: map(#.objectCategories[];category.ID). The # would be the object number of your READ RECORD object that pulled the custom form values (you should be able to select this from the list of variables you can select when clicking into that box to update it).

Now you need to iterate through that array to determine what is or is not attached. use an ITERATOR object and for the array in that module, add the ID's of the custom forms you are wanting to be attached as values. On the path exiting that module, add a filter with the first value being your initial array you created with the SET VARIABLE object, select the comparison of: Does not contain (case insesitive), and the second value of VALUE from your ITERATOR object.

You will now have only missing forms continuing along the execution string which goes to a WORKFRONT MISC ACTION module. set it to a Record Type of Project, and Action of: assignCategories. objID of the record you are updating, and the objCode of the record being updated. under categoryIDs, select the VALUE value from the ITERATOR record.

it works really slick once i figured this out. I have a webhook I setup for Workfront for any new or changed project and it will evaluate this to ensure every project record will always have the 3 required custom forms attached. This is handy as I have one custom form that I don't give anyone access to, that just stores values on the project that I can use for various integrations, like storing the GUID of the linking object in the other system. The process defined above is how I can attach it and no one has access to it to mess up the values.

This ends up with a process that is only 4 objects long, with 1 filter, and no wonky data adds to the Workfront Object to make another finding mechanism.

If you have troubles with this I can get some screenshots to help, but this has worked great for me.

-Aaron

5 replies

skyehansen
Community Advisor
Community Advisor
November 20, 2021

according to the API explorer in the object category section, you should reference the object category's categoryID rather than its ID, if you plan to match it with a custom form ID. Are you able to do that and does it return better values (that actually match something you have)?

RandyRoberts
Community Advisor
Community Advisor
November 20, 2021

Hi Skye,

Good catch, unfortunately, I can't find a way to get that in Fusion.

Result:

I added a categoryObject.categoryID column to the report and it looks like it matches up. Thanks for that tip!

So I'm guessing I have to use the "objectCategories.ID" in Fusion and manually match it up with the "objectCategories.categoryID" in Workfront to know the name of the form I'm looking for when there are multiple forms in a collection.

That's WAAAY harder than it should be!

I'll need to look for 6102ee5c0004298052d658bf37d89a41 because that is the "objectCategories.ID" of the form that has the "categoryID" 5ed7c604024fe585b29e5894d8da05a9.

Which begs the question, Why more than one ID? Why make it so hard?

RandyRoberts
Community Advisor
Community Advisor
November 20, 2021

Scratch That idea, the objectCategories.ID of each bundle is different even if it's the same form I'm looking for.

Is there no way to get the ID of a project form when there are more than one? I need to find projects that do NOT have the form ID 5ed7c604024fe585b29e5894d8da05a9.

Doug_Den_Hoed__AtAppStore
Community Advisor
Community Advisor
November 20, 2021

Hi Randy,

Plan B: add a checkbox parameter with the same name as the form to the form, defaulting it to true, save, confirm it propagated, then in Fusion, change your search to return every object that is missing that true value (and by 1:1 deduction, that form), then add it.

As a bonus, you can then create a standard Workfront Report to easily and instantly visualize every object that is missing that custom form (and for those without Fusion, simply bulk update them to add the form).

Regards,

Doug

William--
Community Advisor
Community Advisor
November 21, 2021

Hey Randy,

Doug's solution will work, and I've used similar helper fields like that in the past to facilitate form maintenance.

If you have your heart set on searching for "Form xyz not attached," the below custom API call module would return those records. The highlighted parameters could also be used as a filter between two other modules if you are working with a collection of records that was returned through some other method.

If you like my content, please take a moment to view and vote on my Idea Requests: https://tinyurl.com/4rbpr7hf
RandyRoberts
Community Advisor
Community Advisor
November 21, 2021

Thank you Skye, Doug & Bill,

I think I will use Doug's solution… with a small twist. I'll create a "Form Name" field that just lists the name of the form. Then: If "Form Name" NOT contains "Project Form | Project" (or any other form name) then… etc.

This way I can re-use the same field on all forms instead of a different field for every form.

It still puzzles me why I cannot list the ID of all forms on a project, and why the objectCategories IDs don't match the category IDs.

I think I'll open a ticket and ask how this works for some clarity. I'll share if/when I get a good answer.

AaronAb1Accepted solution
Level 2
November 22, 2021

Hi Randy,

I struggled with this exact same thing trying to enforce a set of 3 custom forms onto every project. I am not sure from a search function, but from a READ RECORD object, show advanced settings, and for collections, click the slider to MAP and put in: objectCategories:category:*

this will get the ID of all of the custom forms attached to the project. If you use the automatically mapped collection, and not manually mapping it, near as I can tell you get an ID for some type of connection record, that links the project to the custom form, not the ID of the custom form itself.

Once you have done this, you need to create a variable using a SET VARIABLE object to contain the array of form IDs. Name your variable, I have lifetime set to one cycle, then for the value, use: map(#.objectCategories[];category.ID). The # would be the object number of your READ RECORD object that pulled the custom form values (you should be able to select this from the list of variables you can select when clicking into that box to update it).

Now you need to iterate through that array to determine what is or is not attached. use an ITERATOR object and for the array in that module, add the ID's of the custom forms you are wanting to be attached as values. On the path exiting that module, add a filter with the first value being your initial array you created with the SET VARIABLE object, select the comparison of: Does not contain (case insesitive), and the second value of VALUE from your ITERATOR object.

You will now have only missing forms continuing along the execution string which goes to a WORKFRONT MISC ACTION module. set it to a Record Type of Project, and Action of: assignCategories. objID of the record you are updating, and the objCode of the record being updated. under categoryIDs, select the VALUE value from the ITERATOR record.

it works really slick once i figured this out. I have a webhook I setup for Workfront for any new or changed project and it will evaluate this to ensure every project record will always have the 3 required custom forms attached. This is handy as I have one custom form that I don't give anyone access to, that just stores values on the project that I can use for various integrations, like storing the GUID of the linking object in the other system. The process defined above is how I can attach it and no one has access to it to mess up the values.

This ends up with a process that is only 4 objects long, with 1 filter, and no wonky data adds to the Workfront Object to make another finding mechanism.

If you have troubles with this I can get some screenshots to help, but this has worked great for me.

-Aaron

ChrisBudgen
Level 5
November 22, 2021

Hi,

we mostly solve that via a filter:

RandyRoberts
Community Advisor
Community Advisor
November 22, 2021

This one didn't work either. It should have blocked bundle 3 and 4 as they already had the Project Form 5ed7c604024fe585b29e5894d8da05a9

ChrisBudgen
Level 5
November 22, 2021

Two questions:

  1. Are you using the "Does not Contain" Text-operator (this is what we use) or the Array-operator?
  2. How do you call the objectCatgories? Via the collections? Here a screenshot how we call them

RandyRoberts
Community Advisor
Community Advisor
November 22, 2021

I think changing my collection search from "objectCategories:category:*" to the one you use, "objectCategories:*" did the trick! It's more data being pulled but it seems to work, Thanks!

I really appreciate the help you all have offered. Hopefully, others will learn from this thread too.

ChrisBudgen
Level 5
November 23, 2021

You could also use objectCategories:categoryID to get the collection, this should also work.