Skip to main content
Solved

Click through to URL

  • September 20, 2021
  • 3 replies
  • 39 views

Karlstens
Forum|alt.badge.img+24

Progressing with Javascript and airtable, was distracted with the thought - can I gear a scripting app button to open a link?

I know I that the button fields can open links within a base (but annoyingly their labels can’t be configured on a per record basis).

The below simply posts the selected link in the output, but is there a method that allows to open directly into a new tab upon clicking the button?

let button_test = await input.buttonsAsync( 
    "abc this is a test",
    [
          {label: 'Google', value: 'https://google.com'},
          {label: 'Bing', value: 'https://bing.com', variant: 'primary'},
          {label: 'Yahoo', value: 'https://ask.com', variant: 'secondary'},
          {label: 'DuckDuckGo', value: 'https://duckduckgo.com', variant: 'danger'}
    ]
)
output.markdown(`### Link: ${button_test} `)
output.inspect(button_test)

Best answer by kuovonne

Ahh cool, but I’m just checking - that there’s no way to format a html click-through in the shape of a button?


Sorry, but no. Output in Scripting app is very limited.

3 replies

kuovonne
Forum|alt.badge.img+29
  • Brainy
  • 6009 replies
  • September 20, 2021

You can output a markdown link. But you can’t do any styling.

output.markdown(`[link](${button_test})`)


Karlstens
Forum|alt.badge.img+24
  • Author
  • Brainy
  • 602 replies
  • September 20, 2021

You can output a markdown link. But you can’t do any styling.

output.markdown(`[link](${button_test})`)


Ahh cool, but I’m just checking - that there’s no way to format a html click-through in the shape of a button?


kuovonne
Forum|alt.badge.img+29
  • Brainy
  • 6009 replies
  • Answer
  • September 21, 2021

Ahh cool, but I’m just checking - that there’s no way to format a html click-through in the shape of a button?


Sorry, but no. Output in Scripting app is very limited.