How to print "Not set" when there is no value assigned for DNG custom attribute in RPE template?
![]() I am retrieving custom attribute value from DNG into RPE template by using query (dataSource/artifact/collaboration/attributes/objectType/customAttribute/name ) and (dataSource/artifact/collaboration/attributes/objectType/customAttribute/value) which is working fine when the value is true/false.
Now I want to add a condition to print "Not set" when there is no value assigned for that custom attribute. I have tried several things as below,
1.
if(value != "") {
attribute_value = value
}
else
attribute_value = "Not Set"
}
2. provided condition in a container (value == "No value"), print "Not Set" in the text element.
But it is not printing "Not set" in case of no content.
Can anybody please help on this?
|
Accepted answer
One other answer
![]()
Hi Anjuri,
is it a boolean attribute?
You could try first assigning the value of the boolean attribute to a string variable.
Then query the value of the string variable instead of querying the value of the attribute.
It should be either 'True', 'False' or blank.
If it is blank then assign the value "Not Set'
Then publish the variable instead of publishing the attribute value.
Comments Hello Sean,
Thank you so much for your response. Yes, it is a Boolean attribute. I tried initializing variable same as mentioned in https://jazz.net/forum/questions/253483/rpe-dng-how-can-i-access-an-empty-attribute-and-replace-it-with- and it started publishing "Not set" when the value is blank.
Thanks!
|