Adding Multiple Rows from Text Entry Lines with a Single Button Press in Glide

Hi Glide Community,

I’m working on a Glide app where I’d like to streamline a process:

  1. I have a single Text Entry box where users can input multiple lines of text (one item per line).
  2. When a button is pressed, I’d like each line of text to create a new row in a specific table.
  3. Each new row should not only contain the line from the Text Entry but also populate other columns with predefined data.

For example:
If my Text Entry contains:

Item 1
Item 2
Item 3

On pressing the button, I want 3 rows to be created in a table on a specific sheet name:

What I’ve Tried

  • Adding a button with the “Add Row” action works for creating one row but doesn’t address splitting the input into multiple lines.
  • Using Computed Columns (e.g., splitting the Text Entry into an array) doesn’t seem to integrate easily with the Add Row action.
  • Manually creating multiple Text Entry boxes and assigning them individual actions would work but is impractical for 10–20+ lines.

Challenges

I’d like this to be efficient, so users don’t have to manually press the button for each line. Ideally, the solution would:

  • Split the Text Entry input into an array (one item per line).
  • Use that array to dynamically create a row for each item in the table.

Questions for the Community

  1. Is there a JavaScript column or preferably another method using Glide Tables Computed columns that can split the text and handle the row creation in Glide?
  2. Has anyone implemented a similar solution, and if so, how?
  3. Are there any external integrations or creative workarounds you’d recommend to accomplish this?

Any advice or examples would be greatly appreciated!

Thanks in advance for your help.

— Duncan Tilka

Use a form container using a new table that you will use to temporarily store the data entered by the user. Add your text input.

Here is the data table for final data.

Right click on the data table and show API. You will need to note the columns’ key, the table id and the app id. Also copy the api secret key:

In the temp table, add a JavaScript column:

const lines = p1.split(/\r?\n/)
const appID = "ZdYhAx4mlLWUHZX7BpSO"; <--- change this to your app id
const mutations = lines.map(line => (
{
        "kind": "add-row-to-table",
        "tableName": "native-table-9jiFvByoqLAI4fpLffY9",<----- change this to your table id
        "columnValues": {
  change this to your column key ---->   "57117": "Predefined data here",
       change this to your column key ---->  "Name": line
        }
 }
));

const finalJSON = {
  appID: appID,
  mutations: mutations
};

const jsonString = JSON.stringify(finalJSON, null, 2);

return jsonString ;

Set p1 to the input column:



Add a workflow on the onSubmit event:

Add a Call API action:
Set the endpoint to https://api.glideapp.io/api/function/mutateTables
Set the method to POST
Set two query strings:

  1. Authorization: Bearer
  2. Content-Type: application/json

For the predefined data, you can set that in the add row actions.
chrome_MlVwkyCPgd

4 Likes

Sure!

There 2-3 ways (Maxime showed one) but I’d use the new Workflows feature:
https://community.glideapps.com/t/glide-workflows-schedule-trigger-beta/

but we need to wait until the Webhook trigger is released (coming soon) to make this easier and in real-time. In any case using your example, you will consume 4 updates to carry it out

1 Like

Thank you both for the solutions! Wow I super appreciate your help.

1 Like

Thank you so much for taking time to explain and show this. Going to look it over in depth.

1 Like

It was my pleasure ! Anytime! :smiley:

1 Like

Minor point. They should actually be set in the HTTP Header, rather than passed as query parameters.

1 Like

You are right!

Then, is there a way to store a private api key in a table and use it as a secret? As example, having multiple calls with the same api key, without having to duplicate it everywhere…

You can, but it won’t be secure.

2 Likes

At least if you are the only one to use the app.