Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Re: Update input label "Step <X>/100" as a tidy "stop early" button

1258 3
cancel
Showing results for 
Search instead for 
Did you mean: 
Ken_Hanson
4 - Data Explorer
4 - Data Explorer

I’ve got a script that chunks through API requests out to a 3rd party, and instead of outputting a ton of status text, I thought it would be a great UX if they could see the progress of those requests and be able to stop them early, all in the same button.

Is this possible to update an input button’s label after it has been sent to the UI?

If that isn’t possible, is it possible to update an output string similarly?

I’ve tried a few things that might have worked normally outside of airtable, but haven’t had much luck as most of these communication objects don’t return themselves to be overridden later.

Would be happy to hear any weird ways this can be accomplished as well (another table in the base that contains the value, etc).

It doesn’t have to be elegant, just has to be update-able haha

4 Replies 4

Welcome to the Airtable community!

Airtable scripts have very limited input/output capabilities. It was actually inspired by command line interfaces. Thus, you cannot change anything previously output by the script (except for clearing the screen).

One possibility is for your script to continuously clear the the screen (output.clear()) and put your new step /100 text on the screen. This technique was used by old command line interfaces as well.

You also cannot change the label of a button field–it is set in the field’s configuration and must be the same for all rows.

Finally, if you want a lot of control over your input/output, look into creating a custom app. Custom apps are a lot more work that scripts, but also are capable of doing a lot more.

Thanks @kuovonne, very helpful. Figured I’d share what I built :slightly_smiling_face:

Now that I understand the inspiration, clearing output makes a ton of sense and I whipped up a pretty sharp UI to provide our staff with investigation capabilities by ingesting algolia API endpoints (ALSO working around Algolia’s analytics API shortcomings we did not instrument properly to deal with).

Essentially, we pull 1,000 top searches, and then roll through each search looking for a specific influencer’s individual search counts for those terms. It’s not perfect, but it’s saving their bacon while the product team reacts to the need (yay airtable!)

There’s a lot of unimportant domain knowledge here being shown, but this script successfully uses most of the scripting capabilities from airtable including:

  1. Fetch from external api’s (Algolia analytics in this case)
  2. Multiple tables
  3. createRecordsAsync
  4. selectRecordsAsync
  5. deleteRecordsAsync
  6. automations for keeping the top 1k searches fresh
  7. input buttons/text
  8. outputs

The below gif shows a fast, shallow depth against the top 10 search results for a specific shop:

2021-08-03 17.47.45

Edit: source for the unicode progress bars I stole from to create the old school command line progress bar, to really embrace your inspiration haha: Unicode progress bars


image

Thank you for coming back and sharing your creation, especially the animated gif. It really show off the capabilities well.

Any style points scored in the Sripting app are hard-earned, this looks great.