Can a DC Attribute Text Box (Summary/Description) contain a Formula and html Formatting?

I’ve hit the problem mentioned in the following post, where changing one option across multiple selected components causes each attribute set to “users can see this attribute” to clear to a static number, identical across the board:

Formulas replaced with Values when changing multiple dynamic component options

I have 3 attributes I’d like displayed for the customer: Price, Bottle count, and Price per bottle. Since I can’t use “users can see this attribute” boxes, is there a way to drive my “Summary” attribute to show all 3 attributes, combining the string labels and the values with
line breaks between each? You can see what I’m trying to do here:

You can use html in the name, description, summary and itemcode, take a look at :

Html is restricted see :

Oh that’s good to know, thank you. Now how do I use html in conjunction with multiple references to attributes?

I have:
a_ListPrice
b_BottleCount
c_CostPerBottle

and I want the Summary to show:
=concatenate("List Price: ",a_ListPrice) < b r >
=concatenate("Bottle Count: “,b_BottleCount) < b r >
=concatenate(”$ per Bottle: ",c_CostPerBottle)

but since I’m guessing we can’t have multiple formulas in a field, maybe:
"List Price: "&a_ListPrice < b r >
"Bottle Count: "&b_BottleCount < b r >
"$ per Bottle: "&c_CostPerBottle

something like that?

You seem to be under the false impression that the concatenate() function can only take 2 arguments.

=concatenate("List Price: ",a_ListPrice,"Bottle Count: ",b_BottleCount,"$ per Bottle: ",c_CostPerBottle)

… or …

=concatenate("List Price: ",a_ListPrice,"<br/>","Bottle Count: ",b_BottleCount,"<br/>","$ per Bottle: ",c_CostPerBottle)

:question:

1 Like

I do not think this is true. For example in the onClick() function you can have several animate() function calls (of whatever kind you like) separated by semi-colons.

I see what’s going on- I was writing html line breaks in my responses, but they weren’t showing up.

I’d like each of my 3 statistics to exist on a different line so I don’t end up with…

List Price:
$100 Bottle
Count: 45
Cost Per
Bottle:$2.22

…or something equally broken up depending on the width of the window

So,… then how does the 2nd example above work for you (with only 2 breaks) ?

Yes you need to escape < and > brackets in the forum using a backslash \.

… unless it is within a ```html or ```xml code block.

Don’ t use concatenate , use the Html inside brackets and concatenate with ‘&’ , like this:
= "<font color=red>list price :<\font> " & a_listprice & "<br><font size=1><font color=red>Bottle count : <font color=grey> " & b_bottlecount

1 Like

Both ways work great. Very easy, thanks! My semantics were off, thanks for the help!!

2 Likes

This topic was automatically closed after 91 days. New replies are no longer allowed.