Expand my Community achievements bar.

The next phase for Workfront Community ideas is coming soon. Learn all about it in our blog!
SOLVED

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

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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. 

View solution in original post

6 Replies

Avatar

Correct answer by
Community Advisor

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. 

Avatar

Level 2

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

Avatar

Community Advisor

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.

Avatar

Level 10

I had no idea they put the reporting videos up. Then again, I haven't looked for a while 

Avatar

Level 10

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.