Forum Discussion

JimHarrison's avatar
JimHarrison
Qrew Champion
4 months ago

Rich Text field with Large Image: Resizing the Image to Fit

edited for clarity

We notice when Users insert large images into Rich Text fields in New Style Forms, the image extends beyond the edge of the Rich Text field. We would like the image to be constrained by the Rich Text field boundaries. Any ideas?



------------------------------
Jim Harrison
transparency = knowledge + understanding : The Scrum Dudes
------------------------------

5 Replies

  • This is a manual entry text field right? You could try and create a formula-rich text that you only show on 'View' that does a SearchAndReplace() on the rich-text field and swap out the <img tag with <img style='width: 50px' or something like that - basically trying to override the saved image tag someway. The actual img gets stored as the base64 string so it looks like <img src="data:image/png;base64....." so you would by inserting the style tag essentially. 

    This would only work on view though - if you wanted it more permanent you could consider trying to do the same thing with a pipeline or webhook to do the same concept but actually save it with the style in the tag. 



    ------------------------------
    Chayce Duncan
    ------------------------------
    • JimHarrison's avatar
      JimHarrison
      Qrew Champion

      Appreciate your ideas Chayce!

      Correct, the text field is manual entry. The View idea is a good one but does not meet the requirements in our use case. I will try out the Webhook/Pipeline idea, that could work.



      ------------------------------
      Jim Harrison
      transparency = knowledge + understanding : The Scrum Dudes
      ------------------------------
      • ChayceDuncan's avatar
        ChayceDuncan
        Qrew Captain

        You could use the formula as a way to validate the swap and if it works as intended just copy that formula into the rich-text field via an automation. Gives you at least the confirmation that it's working and you can test out or dynamically play with the sizes



        ------------------------------
        Chayce Duncan
        ------------------------------
  • I realize it's basic, but is there an option to push the responsibility back onto the user? If your user double-clicks on the image, they'll get a pop-up that allows for adding size constraints.



    ------------------------------
    Blake Harrison
    Systems Analyst / Quickbase Developer
    BCF Partners Capital
    Houston TX
    ------------------------------
    • JimHarrison's avatar
      JimHarrison
      Qrew Champion

      Hi Blake,

      Good idea. This is also an option. If this option was implemented, what is the expected response from Users? 

      I think folks who are comfortable in Quickbase would know what to do but others would feel "gated" by adding such a requirement. 

      Regards,



      ------------------------------
      Jim Harrison
      transparency = knowledge + understanding : The Scrum Dudes
      ------------------------------