0

Styling a portion of a formula

I have tried this without success so far.  Is there a way to Style  'Files' only bit  in this formula.  Files is a formula given the number of attachments for this record.

The Files formula is:  cnt(files(this))

Formula I am trying to Styl only Files (field)

 

styled(" Attached Files: " + Files, " ", " ", " ") + " ➡️  " + BUILDING.'BUILDING NAME' + " " + 'ROOM NUMBER/LOCATION' + " " + BUILDING.'BUILDING LOCATION'

10replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
    • Alan Cooke
    • Alan_Cooke
    • 12 days ago
    • Reported - view

    I am aware that the "" contain nothing here - I want to colour RED but have been unable to so far.

    Like
    • Fred
    • Fred
    • 10 days ago
    • Reported - view

    I’m guessing using HTML you can. But one of our HTML wizards would have to respond.

    Like
    •  Alan Cooke Like Fred said, you could use html with CSS styling to do so:

      html("<div> Attached files: <span style='background-color:red;color:white;'> " + Files + "</span> ➡️" + BUILDING.'BUILDING NAME' + " " + 'ROOM NUMBER/LOCATION' + " " + BUILDING.'BUILDING LOCATION' + "</div>")

      (I hope I didn't forget any double quotes here)

      Like 1
      • Alan Cooke
      • Alan_Cooke
      • 10 days ago
      • Reported - view

      RoSoft_Steven Worked a charm with a small tweak to get '0' red

      Like
      • Alan Cooke
      • Alan_Cooke
      • 8 days ago
      • Reported - view

      RoSoft_Steven Hi:  I am trying to use this neat styling to tweak other 'banner' formulae.  I cannot get this one to work - can you assist please?

      if PROTOCOL then
          'SELECT BUILDING, ROOM & DESCRIPTION'.BUILDING.'BUILDING NAME' + " " + 'ROOM NUMBER' + " - " + 'SELECT MANUFACTURER/SUPPLIER'.MANUFACTURER + " " + MODEL + html("<div> <span style='background-color:;color:red;'> + [" + PROTOCOL + "]</span></div>")

      I want the [ PROTOCOL] all in red.  As it is now there is no change in color.

      Like
  • maybe change this in your last line code:
    html("<div> <span style='color:red;'>[" + text(PROTOCOL) + "]</span></div>")

    Like
      • Alan Cooke
      • Alan_Cooke
      • 7 days ago
      • Reported - view

      RoSoft_Steven After a good 20 minutes I got it!

      html("<div> <span style='background-color:;color:green;'> PROTOCOL: " + PROTOCOL + "</span> ➡️" + 'SELECT BUILDING, ROOM & DESCRIPTION'.BUILDING.'BUILDING NAME' + " " + 'ROOM NUMBER' + " - " + 'SELECT MANUFACTURER/SUPPLIER'.MANUFACTURER + " " + MODEL + "</div>").

      However I now have this issue when using an if/then when no Protocol is set.  I tried it the other way around if Protocol vs if Not.... same issue.  Can you figure out the issue?

      Like 1
      • Alan Cooke
      • Alan_Cooke
      • 7 days ago
      • Reported - view

      Alan Cooke Figured it out!!

      So for anyone here wanting to use HTML to style here is a chain of posts that lead to a solution

      if PROTOCOL then
          html("<div> <span style='background-color:;color:green;'> PROTOCOL: " + PROTOCOL + "</span> ➡️" + 'SELECT BUILDING, ROOM & DESCRIPTION'.BUILDING.'BUILDING NAME' + " " + 'ROOM NUMBER' + " - " + 'SELECT MANUFACTURER/SUPPLIER'.MANUFACTURER + " " + MODEL + "</div>")
      else
          html("<div> <span style='background-color:;color:;'> </span> " + 'SELECT BUILDING, ROOM & DESCRIPTION'.BUILDING.'BUILDING NAME' + " " + 'ROOM NUMBER' + " - " + 'SELECT MANUFACTURER/SUPPLIER'.MANUFACTURER + " " + MODEL + "</div>")
      end

      Like
      • Fred
      • Fred
      • 7 days ago
      • Reported - view

      Alan Cooke 👍🏽 

      Ninox does not like if statements with two different type of responses. The “then” was a text response and the “else” was html. You fixed it by making both html. 

      Like 1
      • Alan Cooke
      • Alan_Cooke
      • 7 days ago
      • Reported - view

      Fred I figured that could be the reason hence my mod.

      Like
Like Follow
  • 7 days agoLast active
  • 10Replies
  • 93Views
  • 3 Following