Updating Custom Expressions in Custom Forms via API | Adobe Higher Education
Skip to main content
February 24, 2025
質問

Updating Custom Expressions in Custom Forms via API

  • February 24, 2025
  • 2 の返信
  • 504 ビュー

Hey all,

I'm trying to update customExpression values (those calculation fields in Calculated form for Custom Forms) through the API. Looks like I can't update CTGPEX directly.

Is going through the Category object the only option? Seems a bit much to update all CategoryParameters when I only need to change a few customExpression values. Plus, I haven't even had luck with that approach.

Any ideas on how to directly update those customExpression fields?

Thanks!

このトピックへの返信は締め切られました。

2 の返信

LToledo作成者
February 24, 2025

For anyone facing a similar challenge, here's how I managed to update customExpression values --

It turns out you do need to update the Category object, and unfortunately, it requires including all CategoryParameters, even those without custom expressions. I haven't found a more efficient method yet.

Here's the general approach that worked for me:

 

PUT https://{workfront}.{instance}.workfront.com/attask/api/v19.0/CTGY/{category_id} { "categoryParameters": [ { "ID": f"{category_param1.categoryID}_{category_param1.parameterID}", "customExpression": custom_expression }, { "ID": f"{category_param2.categoryID}_{category_param2.parameterID}", "customExpression": custom_expression }, ] }

 

skyehansen
Community Advisor
February 25, 2025

Have you ruled out going through the ctgypa itself? It's the end of my day but I'm happy to look into ctgypa tomorrow if you haven't ruled it out -- just tell me what issues you're having with it so I don't have to replicate all your errors.

LToledo作成者
February 25, 2025

I believe did try updating through the CTGYPA object before, but I might have missed something. I'd really appreciate it if you could take a look tomorrow and see if you can get it working. Thanks!

skyehansen
Community Advisor
February 25, 2025

I'm getting a "must specify an ID to edit" error, and none of the ID fields seem to be acceptable (tried category ID and parameter ID). Is this what you ran into as well?

 

I'd like to have found a way to link down to the CTGPEX ID itself similar to what you did above (cat ID + parameter ID + category parameter expression ID) but it's not gelling (and may well be going down the wrong path)