UseSQL
  • Introduction
  • Getting Started
    • Source Formats
    • Output Formats
    • Managing Keys
    • Sandbox
    • Saved Queries
  • Client Libraries
    • HTML Templating
    • JavaScript Web Client
  • Tutorials
    • Integrate With Your Static Site
    • Share Data In Slack
    • Show external query results in a Google Sheet
    • Query across a Google Sheet and a CSV file
    • Securing Your Key
    • Querying Airtable
    • Integrate With ProcFu
    • Integrate with a private Google Sheet
    • Updating Google Sheets
    • Retrieving data from tables on a web page
    • Displaying reports in Google Sheets from MySQL
    • Querying StackBy Tables
  • Resources
    • Demo Sandbox
    • OpenAPI Docs
    • Redoc API Docs
    • Roadmap
    • Changelog
Powered by GitBook
On this page
  • Step 1: Create A New Screen
  • Step 2: Update Screen Behaviors
  • Step 3: Save Your Results And Enjoy!

Was this helpful?

  1. Tutorials

Integrate With ProcFu

PreviousQuerying AirtableNextIntegrate with a private Google Sheet

Last updated 4 years ago

Was this helpful?

It's pretty easy to surface your query results in ProcFu if you are looking to do so. Below are the steps you will need to take.

Step 1: Create A New Screen

The first thing you will want to do when integrating UseSQL with one of your Profu Apps is to create a new screen of type "Text Information". After in the section where is says markdown text you will need to make sure to add an html element, which is valid in the markdown text field, with an identifier. In this example we will name it "sql-result".

Step 2: Update Screen Behaviors

fetch('https://usesql.com/sql?query=SELECT%20a.Symbol%2C%20a.Security%2C%20b.Executive%20%0AFROM%20%22https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FList_of_S%2526P_500_companies%22%20a%20%0AJOIN%20%22https%3A%2F%2Fraw.githubusercontent.com%2Fdylanroy%2Fceo-dataset%2Fmain%2Fdata.csv%22%20b%20ON%20a.Security%20%3D%20b.Company&format=html&key={YOUR_API_KEY}')
  .then(response => response.text())
  .then(data => document.getElementById('sql-result').innerHTML = data);

You will take the script above, and add your API key, and place it in the "On Render (Javascript)" section as shown below.

Step 3: Save Your Results And Enjoy!

Save your results and visit your ProFu link.

Now that we have a container to write our query results to. We can paste in some Javascript in the "On Render (Javascript)" section under the "Behaviors" tab. Below is some JavaScript you can copy and paste or replace with your own query, and a screenshot of the location to paste it into. Don't forget you can always build your queries in the sandbox at .

https://www.usesql.com/sandbox
https://procfu.com/usesqlprocfu.com