Expand my Community achievements bar.

Come join us for our Coffee Break this WEDNESDAY on top takeaways from Adobe Summit!
SOLVED

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

Avatar

Level 10

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.0694X00000G823QQAR.pngI 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).

0694X00000G8294QAB.pngIf 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.

Topics

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

1 Accepted Solution

Avatar

Correct answer by
Level 2

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

View solution in original post

15 Replies

Avatar

Community Advisor

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)?

0694X00000G82JsQAJ.png

Avatar

Level 10

Hi Skye,

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

0694X00000G831GQAR.pngResult:0694X00000G831BQAR.png

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

0694X00000G82yRQAR.pngSo 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?

Avatar

Level 10

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.

0694X00000G838RQAR.png

Avatar

Community Advisor

well... that might be an exists statement (or notexists statement) for me, working outside of fusion in a report, but here we are inside of fusion trying to use it to get the same result. I'm still a fusion beginner so it's a bit hard for me to see what you did to get here. You're certainly welcome to upload a blueprint if you think it might help or if you're just curious to see whether we can share blueprints of scenarios to troubleshoot.

In the most general terms though, it feels like what you're trying to do might be covered in this module: https://one.workfront.com/s/learningpath4/universal-connectors-and-routing-in-fusion-MCNYZ474LYKNDSD... -- but I really couldn't say for sure. I just remember doing the pokemon exercises and having to pull stuff out of a collection.

Avatar

Level 10

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

Avatar

Community Advisor

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.

0694X00000G84uvQAB.png

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

Avatar

Level 10

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.

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

Avatar

Correct answer by
Level 2

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

Avatar

Level 10

Thanks @Aaron Abbott‚ , this is great. It works but for one issue which I'm sure is because of something I chose incorrectly.

For the example, the "Project Form | Project" form is the one I want to add if it's missing (5ed7c604024fe585b29e5894d8da05a9)

I have 4 Test projects:

One with the Project form and another form, one with just the project form, one with just a different form, and one with no forms.

The problem is the one with the Project form and another form is passing through the filter and getting the project form added a second time. It doesn't mess anything up as the form info stays but it wastes time adding adding a form that's already there. Below are screen shots of what I interpreted your instructions to be:

Set Variable Module

0694X00000G88nZQAR.pngIterator Module

0694X00000G88oIQAR.pngFilter after Iterator0694X00000G88pQQAR.pngAdd Form action module

0694X00000G88rCQAR.pngAs you can see below, bundle 1 is getting through the filter even though it has the correct form plus another form attached.

0694X00000G88nqQAB.png0694X00000G88sjQAB.png

Can you see what I did wrong from this?

Avatar

Level 2

here are similar screenshots that show what I have. I think the filter is where you are running into issues.

here is where i create my array from the project in question:

0694X00000G8BTIQA3.png

then here is the iterator setup:

0694X00000G8BTXQA3.png

then here is my filter:

0694X00000G8BThQAN.png

by including the ITERATOR value rather than the discrete value, it will use the one that is on that particular iteration rather than getting the extras that met part of the filter. this ensures it is comparing only 1 variable at a time against the ones in question, then the UPDATE RECORD object looks like the following:

0694X00000G8BU1QAN.pngall total, this ensures it is only ever testing 1 item at a time, and only passing ones that dont match that need to be added through. no double attaches, just the missing ones. This will also set you up to be ready to add more custom forms if the need arises, all you need to do is add 1 more test to the Iterator, and you are updated to handle your new form.

Hopefully this gets you to the finish line!

-Aaron

Avatar

Level 6

Hi,

we mostly solve that via a filter:

0694X00000G85SEQAZ.png

Avatar

Level 10

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

0694X00000G89KJQAZ.png0694X00000G89MjQAJ.png0694X00000G89JWQAZ.png

Avatar

Level 6

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

0694X00000G89wNQAR.png

Avatar

Level 10

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.

Avatar

Level 6

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