Forum Discussion
WendyShoef
7 years agoQrew Cadet
Overview:
Template stored in a table with multiple languages and place holders for field values using rich text fields.
Template copied with selected language.
Run script to find and replace place holders with the values for the related case when user clicks a button.
I have everything except pulling in the table field values for the elements without an html element ID of the table field id.
Template stored in a table with multiple languages and place holders for field values using rich text fields.
Template copied with selected language.
Run script to find and replace place holders with the values for the related case when user clicks a button.
I have everything except pulling in the table field values for the elements without an html element ID of the table field id.
- hhersch7 years agoQuickbase StaffThanks. Have you tried a Quick Base Automation to do this natively?
- WendyShoef7 years agoQrew CadetI can't see how an automation would work to find placeholders in the rich text field and replace them.
I use automations and webhooks for much of my workflow including copying the templates among other things.
I'm just needing help with what I stated above... reading data from html elements that don't have a corresponding #_fid_. - hhersch7 years agoQuickbase StaffHi Wendy. I don't know the details of the use-case, but Automations definitely can find and edit records. We also released _SearchAndReplace()_ as a formula function. Wherever possible, we would encourage using supported methodologies vs. image onload.
- WendyShoef7 years agoQrew CadetI think you might have helped me down a better path!
I'd rather not use .js [iol] anyways.- Create formula rtf fields for each of the rtf fields
- Use _SearchAndReplace() for the placeholders
- When user clicks button, run automation that saves the formula field values into the regular fields
- WendyShoef7 years agoQrew CadetSo the serchAndReplace works but for only one variable
For example my text says:[Date]
To: [PC]
Client: [Client]
[Delivery Method]
Case: [Case ID]
There are three separate rtf and approximately 25 different variables (may be more as we progress and need this to be an option to be able to implement on the fly as new templates are created).
So I need to be able to iterate over the text such as
Text = [rff field]
Text = SearchAndReplace( Text, "[PC]", [Case - PC Full Name])
Text = SearchAndReplace( Text, "[Delivery Method]", [Delivery Method])
Text = SearchAndReplace( Text, "[Case ID]", [Case - Case ID])
...