Logo Text Blaze

  • Docs
  • Community
  • Business
  • Documentation

    No search results

    Text Blaze

    Loading...

    Data Blaze

    Loading...

    Community Forums

    Loading...
  • Products
    • Text Blaze
      Snippets and templates
    • AI Blaze
      AI writing and editing
    • Data Blaze
      Tables and sheets
    Downloads
    • Add to Chrome
    • Windows app
    • MacOS app
  • By function
    • Support & operations
    • Sales
    • Healthcare
    • Education
    • Recruiting
    • Marketing
    Business
    • For teams
  • Resources
    • Documentation
    • Community forum
    • Gallery
    • Contact us
  • Pricing

Documentation

No search results

Text Blaze

Loading...

Data Blaze

Loading...

Community Forums

Loading...
Add to Chrome –  It's Free! Go to Dashboard ›
Docs > Commands
  • Guides
    • Quick Start
    • Sharing Snippet Folders
    • Dynamic Commands
    • Date and Time
    • Autopilot
    • Forms
    • Formulas
    • Rules & Validation
    • Tables in Snippets
    • Connect Other Apps
    • Tidying Whitespace
    • Lists
    • Read Data from Websites
    • Teams and Organizations
  • Tutorial Videos
  • Gallery
  • Frequently Asked Questions
  • Formula Reference
  • Dynamic Commands
    • Using Dynamic Commands
    • {=} (Formula Command)
    • {button}
    • {click}
    • {clipboard}
    • {cursor}
    • {error}
    • {formdate}
    • {formmenu}
    • {formparagraph}
    • {formtext}
    • {formtoggle}
    • {if}
    • {import}
    • {key}
    • {link}
    • {note}
    • {repeat}
    • {run}
    • {site}
    • {snippet}
    • {time}
    • {user}
    • {wait}
  • Connected Snippets
    • Connected Snippets Overview
    • {image}
    • {urlload}
    • {urlsend}
    • {dbselect}
    • {dbinsert}
    • {dbupdate}
    • {dbdelete}
  • Command Packs
    • Capitalize
    • Gmail
    • LinkedIn
    • Randomize
Commands

{urlsend}

Summary: Sends a message to a URL when a snippet is inserted
Sample Usage
...we will deliver {formtext: name=count} widgets.

{note}Sends a message to acme.com/log_delivery with the widget count when this snippet is inserted{endnote}

{urlsend: https://example.com/log_delivery?widgets={=count}}
_

Settings


Setting NameTypeDescription
General URL Settings
_urlThe URL to request. Fox example, https://example.com/page
methodGET/POST/...The HTTP method used to make the request. Defaults to GET.
bodytextThe body of the request.
headersKey/Value ListA list of headers. For example, Content-Type=text/json,Authorization=Basic 12345
completedfunctionFunction called when the request completes. The function takes the results of the request and returns a string. If the returned string is not blank (""), creates a browser notification with that message.
General Command Settings
trimyes/no/left/rightIf yes whitespace is removed before and after the command. If left, only whitespace to the left is removed. If right, only whitespace to the right is removed.
urlsend is a Connected Snippet command. Connected Snippets are advanced commands currently in Beta. They may change in the future.

The urlsend command allows you to send a message to a server when a snippet is inserted. This can be used for logging snippet usage, or even saving the variables that were used in a snippet.

The command's first positional setting is the URL you want to send data to.

You also have access to settings like method, body, and headers so you can specify the data you want to send.

If the URL contains characters that have special significance in Text Blaze commands, they must be escaped with backslashes. Notably {, }, \ and ; should be escaped by placing a single \ before them.

For example, { would become \{ and \ would become \\.

See the Escaping Special Characters section of the Formula Blaze Reference page to learn more.

Example usage

We recommend using Data Blaze to manage spreadsheet data. It has a built-in public form to collect data graphically. Text Blaze also has built-in integrations to write, update, and delete rows from Data Blaze, check out this guide here.

If you want to write data to Google Sheets, take a look at this example.

You can also develop your own server application to collect and store data from the urlsend command.

See also the {urlload} command for loading data from a server into your snippet.

Handling errors

If the request fails, a browser notification will be shown to the user. You can customize this message and when it is shown by using the completed setting. The completed setting takes a function with two parameters: the response text and response status code. When that function returns a non-blank string a message is shown with the string.

For instance, imagine we have an endpoint that returns JSON with a status property that is either "success" or "error". To show a message when the status is "error" we could use the following completed settings:

{urlsend: ...; completed=(res) -> "An error occurred, please try again" if fromJSON(res).status = "error" else ""}

Sharing connected snippets with others

When sharing snippets with others, snippets containing the urlsend command may only be shared with members of your Text Blaze Business organization.

About

Plans and Pricing
Sharing Snippets
Text Blaze for Business
Forms
Autopilot
Dynamic Commands
Command Packs
Text Blaze for Windows
Text Blaze for macOS

Support

Get Started with Text Blaze
Contact Us
Documentation
Community Forum
Blog
Gallery
Engineering Blog

Solution for

Business
Customer Support
Recruiters
Education
Healthcare
Sales
Property Managers
AI

Other

Privacy Policy
Terms of Service
Open Source Licenses
Affiliate
© Blaze Today Inc