Help with text mode on project report - need to include Risk Type & Risk Description in combined column view | Community
Skip to main content
Level 2
April 25, 2023
Solved

Help with text mode on project report - need to include Risk Type & Risk Description in combined column view

  • April 25, 2023
  • 2 replies
  • 1490 views

I tried every combination I can from API Explorer but nothing seems to pull in data, PLEASE ANY IDEAS ?

displayname=Risk Type & Desc
listdelimiter=<div>
listmethod=nested(risk).lists
textmode=true
type=iterate
valueexpression=CONCAT("* ",{risk}.{riskTypeID},", ",{risk}.{description})
valueformat=HTML

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Richard_Le_

Hi,

 

This should do it:

 

 

displayname=Risk Type & Desc listdelimiter=<div> listmethod=nested(risks).lists textmode=true type=iterate valueexpression=CONCAT("* ",{riskTypeID},", ",{description}) valueformat=HTML

 

 

However, i'm not sure why you would want the riskTypeID as this just returns a 32 character ID that wont mean anything to anyone. Did you mean riskType.name? If so, this would work:

 

 

displayname=Risk Type & Desc listdelimiter=<div> listmethod=nested(risks).lists textmode=true type=iterate valueexpression=CONCAT("* ",{riskType}.{name},", ",{description}) valueformat=HTML

 

 

You were very close. There were a just a couple of issues with your code. in listmethod, you need to use "risks" instead of "risk" because "risks" is the name of the collection in the API explorer. Then for description and riskTypeID in your value expression, there was no need to have {risk} appear before {riskTypeID} and {description}. Workfront already knows you are referencing the risk dataset because we've specified that as the collection in listmethod. . . . If that makes sense.

 

Hope that helps!

 

Best Regards,

Rich. 

2 replies

Richard_Le_Community AdvisorAccepted solution
Community Advisor
April 25, 2023

Hi,

 

This should do it:

 

 

displayname=Risk Type & Desc listdelimiter=<div> listmethod=nested(risks).lists textmode=true type=iterate valueexpression=CONCAT("* ",{riskTypeID},", ",{description}) valueformat=HTML

 

 

However, i'm not sure why you would want the riskTypeID as this just returns a 32 character ID that wont mean anything to anyone. Did you mean riskType.name? If so, this would work:

 

 

displayname=Risk Type & Desc listdelimiter=<div> listmethod=nested(risks).lists textmode=true type=iterate valueexpression=CONCAT("* ",{riskType}.{name},", ",{description}) valueformat=HTML

 

 

You were very close. There were a just a couple of issues with your code. in listmethod, you need to use "risks" instead of "risk" because "risks" is the name of the collection in the API explorer. Then for description and riskTypeID in your value expression, there was no need to have {risk} appear before {riskTypeID} and {description}. Workfront already knows you are referencing the risk dataset because we've specified that as the collection in listmethod. . . . If that makes sense.

 

Hope that helps!

 

Best Regards,

Rich. 

Tom2600Author
Level 2
April 25, 2023

THANK YOU!
THANK YOU!

I have been banging my head for days with this one.

2 questions
1. What happens if there is like 4 risks, will they all appear?
2. Is the a training class you can recommend for writing CAML code for TextMode?

Tom

Community Advisor
April 25, 2023

Glad I could help, Tom.

 

Yes, this code will return all risks entered on a project.

 

The advanced reporting courses on experience league are really helpful, you can find them here. They don't cover everything, but it's a good place to start.

 

It's really all about practice, patience, and more practice 😁. The more you use text mode, the more you become familiar with using the API explorer, the syntax and the different functions. Also, don't be afraid to lean on the community. I've been using Workfront for nearly a decade now, but I still learn so much from the people here. We have some incredibly talented Workfront Ninja's who are always happy to help.

RandyRoberts
Community Advisor
Community Advisor
April 25, 2023

There's no training class for it but it does help if you understand some javascript and how to write Excel formulas. Most of textmode follows standard scripting syntax. It helps to pick apart code you can find here in the forums. If you need explaining, ChatGPT is your friend. In ChatGPT, you can write "Explain: " and then paste the code you found here. It will pick apart the code and do a decent job of explaining it. Do not ask ChatGPT to write your code from scratch, it is a lesson in futility. Trust me on this. 😉

Tom2600Author
Level 2
April 25, 2023

Thank you again! Much Appreciated!