Discussions

Expand all | Collapse all

combine fields using formula rich text

QuickBaseCoach Dev./Training06-21-2019 16:45

QuickBaseCoach Dev./Training06-21-2019 20:05

QuickBaseCoach Dev./Training06-21-2019 21:08

Jeff Richey06-21-2019 21:13

  • 1.  combine fields using formula rich text

    Posted 06-20-2019 20:56
    I have three fields I would like to combine using formula rich text.

    I would like to take the first, a formula text field, and have it show above the second, a formula rich text showing an icon, and have that show above the third, a formula numeric field.

    I am not sure how to structure the HTML for this. Does anyone have any suggestions?


  • 2.  RE: combine fields using formula rich text

    Posted 06-20-2019 21:21
    try this

    List("<br>",
    [a formula text field],
    [formula rich text showing an icon],
    ToText([formula numeric field]))






  • 3.  RE: combine fields using formula rich text

    Posted 06-21-2019 12:20
    Works like a charm. Thanks Mark! Do you happen to know how to format so that all three are centered together?


  • 4.  RE: combine fields using formula rich text

    Posted 06-21-2019 12:32
    I do realize now how I can get rid of the extra leading spaces in front of the first email. I can post that later.

    But I�m not understanding what you mean by all three center together. Do you mean all three separate emails but what do you mean by centered.


  • 5.  RE: combine fields using formula rich text

    Posted 06-21-2019 12:41
    Here is what the result looks like:



    I would like to have these fields all centered instead of left justified.


  • 6.  RE: combine fields using formula rich text

    Posted 06-21-2019 12:54
    OK. I will post back soon. I was mixing up your question with a different one that I answered.


  • 7.  RE: combine fields using formula rich text

    Posted 06-21-2019 14:33
    <div align=\"center\">"

    &

    List("<br>",
    [a formula text field],
    [formula rich text showing an icon],
    ToText([formula numeric field]))


  • 8.  RE: combine fields using formula rich text

    Posted 06-21-2019 14:53


    This looks so much better now! Thanks again Mark.


  • 9.  RE: combine fields using formula rich text

    Posted 06-21-2019 15:58
    I modified this slightly to achieve the following result:



    Now I am trying to line several of these up in an additional formula rich text field with this formula:

    List(" ",
    [Overall_combo] , [Back_combo] , [Neck_combo] , [L Shoulder_combo] , [R Shoulder_combo] , [L Elbow_combo] , [R Elbow_combo] , [L Wrist_combo] , [R Wrist_combo])

    For some reason, they are displayed stacked one on top of the other like a totem pole:



    Any idea how I can get these to display in line horizontally?



  • 10.  RE: combine fields using formula rich text

    Posted 06-21-2019 16:09
    What is happening is that the field is getting wrapped - maybe because its on a report and Quick Base is  trying to fit the columns across the page without side to side scrolling,

    You can do this

    List "_", etc



    to avoid the wrapping, but the "look" might bother you and also it will still try to wrap a double word like

    R Elbow

    What happens on a report if you take away a bunch of columns off the report so this field has lots of room.




  • 11.  RE: combine fields using formula rich text

    Posted 06-21-2019 16:13
    This is on a form within it's own section. I tried adding the underscore in place of the space in the formula list, but get this result:



  • 12.  RE: combine fields using formula rich text

    Posted 06-21-2019 16:37
    Oh, so you want the icons to be horizontal?  can you post your complete code?_


  • 13.  RE: combine fields using formula rich text

    Posted 06-21-2019 16:44
    Sure:

    List("_",
    [Overall_combo] , [Back_combo] , [Neck_combo] , [L Shoulder_combo] , [R Shoulder_combo] , [L Elbow_combo] , [R Elbow_combo] , [L Wrist_combo] , [R Wrist_combo])


  • 14.  RE: combine fields using formula rich text

    Posted 06-21-2019 16:45
    Is that the whole formula including the icons?  


  • 15.  RE: combine fields using formula rich text

    Posted 06-21-2019 16:45
    The combo fields have this structure:

    "<div align=\"center\">"

    &

    List("<br>",
    "Overall",
    "Risk = " & ToText([Grand Total]),
    [Overall Risk Icon],
    [Overall Risk Rating])


  • 16.  RE: combine fields using formula rich text

    Posted 06-21-2019 16:58
    Here is  [Grand Total]:

    Sum(
    [Back Total],
    [Neck Total],
    [L Shoulder Total],
    [R Shoulder Total],
    [L Elbow Total],
    [R Elbow Total],
    [L Wrist Total],
    [R Wrist Total],
    [Accelerators Total]
    )

    Here is [Overall Risk Icon]:

    Case([Overall Risk Rating],
    "Low","<img src=\"h t t p s://XXXX.quickbase.com/up/XXXX/g/re/eg/va/222-point_green.png\" title=\"Low\">",
    "Moderate","<img src=\"h t t p s://XXXX.quickbase.com/up/XXXX/g/rf/eg/va/223-point_yellow.png\" title=\"Moderate\">",
    "High","<img src=\"h t t p s://XXXX.quickbase.com/up/XXXX/g/rd/eg/va/221-point_red.png\" title=\"High\">",
    "Very High","<img src=\"h t t p s://XXXX.quickbase.com/up/XXXX/g/rc/eg/va/204-warning.png\" title=\"Very High\">",
    null)

    Here is [Overall Risk Rating]:

    If(
    [Grand Total]<=20,"Low",
    [Grand Total]>=21 and [Grand Total]<=35,"Moderate",
    [Grand Total]>=36 and [Grand Total]<=55,"High",
    [Grand Total]>55,"Very High"
    )

    Here is an example of one of the individual body part total fields:

    Sum(
    If(ToNumber([Back_Flexed>20])=0,0,1),
    If(ToNumber([Back_Extended])=0,0,1),
    If(ToNumber([Back_Sideways>20])=0,0,1),
    If(ToNumber([Back_Twisted>20])=0,0,1),
    If(ToNumber([Back_Flexed>45])=0,0,1),
    If(ToNumber([Back_Extended>20])=0,0,1),
    If(ToNumber([Back_Force>10 lb])=0,0,2),
    If(ToNumber([Back_Repetition >2/min])=0,0,2),
    ToNumber([Back_Static Exertion>10 sec])
    )

    This is part of an Ergonomic Rick Assessment form.


  • 17.  RE: combine fields using formula rich text

    Posted 06-21-2019 17:37
    ... and if you remove this,

    "<div align=\"center\">"

    does it then go horizontal like you want?




  • 18.  RE: combine fields using formula rich text

    Posted 06-21-2019 18:18
    I need the "<div align=\"center\">" so the combo fields look like this:



    instead of this:



    I tried anyway and the result was:



  • 19.  RE: combine fields using formula rich text

    Posted 06-21-2019 18:18
    I need the "<div align=\"center\">" so the combo fields look like this:



    instead of this:



    I tried anyway and the result was:



  • 20.  RE: combine fields using formula rich text

    Posted 06-21-2019 18:22
    ..I would probably have to have a look at your app or a Copy of your app.  Maybe contact me off line QuickBaseCoach.com


  • 21.  RE: combine fields using formula rich text

    Posted 06-21-2019 19:37
    This:

    "<fieldset >\n\n<td  " & [Overall_combo]  & "</td>\n\n<td  " & [Back_combo]  & "</td>\n\n<td  " & [Neck_combo]  & "</td>\n\n<td  " & [L Shoulder_combo]  & "</td>\n\n<td  " & [R Shoulder_combo]  & "</td>\n\n<td  " & [L Elbow_combo]  & "</td>\n\n<td  " & [R Elbow_combo]  & "</td>\n\n<td  " & [L Wrist_combo]  & "</td>\n\n<td  " & [R Wrist_combo]  & "</td>\n\n</fieldset>"

    Gives me this:

    ">https://d2r1vs3d9006ap.cloudfront.net/s3_images/1794348/RackMultipart20190621-70531-1cilia7-image_inline.png?1561145860">

    ...baby steps


  • 22.  RE: combine fields using formula rich text

    Posted 06-21-2019 19:40
    No need for the fieldset tag:

    "\n<td  " & [Overall_combo]  & "</td>\n\n<td  " & [Back_combo]  & "</td>\n\n<td  " & [Neck_combo]  & "</td>\n\n<td  " & [L Shoulder_combo]  & "</td>\n\n<td  " & [R Shoulder_combo]  & "</td>\n\n<td  " & [L Elbow_combo]  & "</td>\n\n<td  " & [R Elbow_combo]  & "</td>\n\n<td  " & [L Wrist_combo]  & "</td>\n\n<td  " & [R Wrist_combo]  & "</td>\n"

    ">https://d2r1vs3d9006ap.cloudfront.net/s3_images/1794350/RackMultipart20190621-120940-t8dw2i-image_inline.png?1561146051">


  • 23.  RE: combine fields using formula rich text

    Posted 06-21-2019 19:56
    Putting these table cells within a table spread them out equally over the width of the screen:

    "\n<table style=width:100%>\n<td  " & [Overall_combo] & "</td>\n\n<td  " & [Back_combo]  & "</td>\n\n<td  " & [Neck_combo]  & "</td>\n\n<td  " & [L Shoulder_combo]  & "</td>\n\n<td  " & [R Shoulder_combo]  & "</td>\n\n<td  " & [L Elbow_combo]  & "</td>\n\n<td  " & [R Elbow_combo]  & "</td>\n\n<td  " & [L Wrist_combo]  & "</td>\n\n<td  " & [R Wrist_combo]  & "</td>\n\n"




  • 24.  RE: combine fields using formula rich text

    Posted 06-21-2019 20:05
    OK. That looks very pretty!


  • 25.  RE: combine fields using formula rich text

    Posted 06-21-2019 20:05
    Note that leaving off the close tag for the table, </table>, resulting in all of the tabs after that point in the form not displaying any fields...

    ah the importance of closing your tags. :\


  • 26.  RE: combine fields using formula rich text

    Posted 06-21-2019 20:56
    Just to put things in context, here was the end goal that I was aiming for:



    This is all compiled into one rich text field so it will always display proportionately and it is composed of other formulas that change the number for the risk rating and the icon associated with the rating. Ergonomics and risk assessment scores are helpful, but a visual is worth a thousand words.

    Here was the final code for the rich text field:

    "\n<table style=width:100%>
    \n<tr>
    \n<td colspan=\"7\"> " & [Overall_combo] & "</td>\n
    </tr>\n
    \n<tr>
    \n<td  " & [L Wrist_combo] & "</td>\n
    \n<td  " & [L Elbow_combo] & "</td>\n
    \n<td  " & [L Shoulder_combo] & "</td>\n
    \n<td  " & [Neck_combo] & "</td>\n
    \n<td  " & [R Shoulder_combo] & "</td>\n
    \n<td  " & [R Elbow_combo] & "</td>\n
    \n<td  " & [R Wrist_combo] & "</td>\n
    </tr>\n
    \n<tr>
    \n<td colspan=\"7\">\n<img src =\"h t t p s://XXXX.quickbase.com/up/XXXX/g/rb/eg/va/5%20Joints.jpg\"height=200; >\n</td>\n
    </tr>\n
    \n<tr>
    \n<td colspan=\"7\"> " & [Back_combo]  & "</td>\n
    </tr>\n
    </table>\n"  


  • 27.  RE: combine fields using formula rich text

    Posted 06-21-2019 21:08
    Very impressive.


  • 28.  RE: combine fields using formula rich text

    Posted 06-21-2019 21:13
    Nice work Adam.


  • 29.  RE: combine fields using formula rich text

    Posted 06-21-2019 21:14
    Thanks guys. The people in the community have been so helpful, I want to offer something in return when I can.