Modify the formula in the button to replace JavaScript

Prev Next

Modify the formula in the field to replace JavaScript

If you have not yet visited the page Modify your button field type from Formula URL to Formula Rich Text, do so before making the following changes.

Note

If you're already familiar with this process, change the field type of the fields that run your extensions from Formula URL to Formula Rich Text.

Edit the field properties for your extension fields

Field properties for a field recently changed to Formula Rich Text

Identify the JavaScript lines in your formula

Formula editor with the first and last JavaScript lines highlighted

Delete the highlighted code

Delete everything highlighted in the previous image, including everything in the first line up to the https. This URL is different for everyone and for each extension.

Add a double quote to the beginning of the URL

Double quote added to the beginning of the URL

Add code to the beginning of line 1

Copy the following line and add it to the beginning of line 1:

var text url =

Important

Make sure you copy this line into your formula before continuing.

Paste it into the formula. It should look something like this:

Formula editor showing the var text url line added to line 1

Note

Everyone's button formula looks a little different. Focus on finding the JavaScript and removing it.

Add code to the end of your formula

Copy the following line and add it to the end of your formula, where you deleted the JavaScript earlier:

;

"<a class='Vibrant Success OpenAsPopup' data-height=1000 data-width=1000 data-refresh=true href=\"" & $url & "\" > (Name Your Button Here...) </a>"

Important

Make sure you copy this line into your formula before continuing.

Paste it into the formula. It should look something like this:

Formula editor showing the new anchor code added to the last line

Customize your completed formula

This is a completed formula. By using Formula Rich Text fields, you have advanced customization features within your button formula that you can easily modify to fit your needs.

Completed formula with customization options highlighted

Learn more about Rich Text button styling and customizing. This includes different colors for the button, recommended height and width for each extension, and recommended ways to name the button.