Solved

Conditional Expressions Text Output

  • 12 August 2023
  • 2 replies
  • 70 views

Userlevel 1
Badge +4

 Hello 

 

I would like to know if there is anyway I can print out a “String” based on the parent task field value

 

$CURRENT_VALUE + “Reporter Name” + $new.affectedUser.name +"<br>" + "Technology = "+ $new.parentEvent.W("TECHNOLGY").name +"<br>"+ "Start Date = "+ $new.parentEvent.W("ACCESS_START_DATE") +"<br>"+"TEMPORARILY_ACCESS"+" == "+ $new.parentEvent.W("TEMPORARILY_ACCESS")

 

So basically what I’m trying to do 

rather than the users in each task have to access the main record I want to output the fields directly from the parent ticket into the tasks, which I have done successfully, 

 

 

my problem is the field “Technology” as it is a single select field and act as a visibility filter based on value for multiple WebCustomGroups on the same form,  which have additional or different fields besides the common details

 

so I would like to show a different text output for each value of “Technology”

right now most fields on the form shows as NO VALUE when called via the expression and I want to hide that to only show the detail for the chosen webCustomGroup

 

 

 

icon

Best answer by Alan Macfarlane 14 August 2023, 10:11

View original

2 replies

Userlevel 2
Badge +5

Hi

 

You should be able to wrap the output in conditional expressions. So something like this may work:

if ($new.parentEvent.W("ACCESS_START_DATE") <> $NO_VALUE, “Start Date=” + $new.parentEvent.W("ACCESS_START_DATE"), “”)

 

Userlevel 1
Badge +4

 

Thank you Alan, 

 

it worked, although for some reason it only hides “NO VALUE” 

 

but it still shows 

Start Date= 

 

I have made few modification and worked as per my need

 if the field is empty it won’t write anything if there is a value it will evaluate and print the statement
 

if($new.parentEvent.W("ACCESS_START_DATE") <> "", "<br> START DATE=" + $new.parentEvent.W("ACCESS_START_DATE"), "")+
if($new.parentEvent.W("IMPACTED_SERVICES") <> "", "<br> IMPACTED_SERVICES=" + $new.parentEvent.W("IMPACTED_SERVICES"), "") +
if($new.parentEvent.W("REMARKS") <> "", "<br> REMARKS=" + $new.parentEvent.W("REMARKS"), "")
START DATE= no value
IMPACTED_SERVICES = “This should show”
REMARKS= no value

 

Reply