Skip to content
The Chat Archive
o3-2025-04-16· OpenAI LMArena Human Preference 140K

is this possible withou invoking backup service nor manually pasting by the user?

  1. User

    is this possible withou invoking backup service nor manually pasting by the user?

  2. Assistant

    Short answer: no, not with a “pure” card.
    Google Chat’s card-UI is static; it can’t do string substitution inside an openLink.url.
    Anything that changes the URL at click-time (or even at type-time via onChangeAction) must go through a Chat-app (a back-end) that receives the form event and returns a new card or an actionResponse with the finished URL.

    Why it can’t be done client-side

    1. openLink.url must be a literal string in the JSON.
      Place-holders like {{comment}} are only expanded when they are sent back to the app in the formInput object—not inside the card itself.
    2. The only interactive hooks (onChangeAction, action, submitForm) deliver the user’s input to the Chat-app; they do not allow you to mutate the same card without a server round-trip.
    3. A card that is sent by a human (pasted JSON or Card Designer) has no associated “app” to receive those hooks, so the events go nowhere.

    What your options really are A. Build a lightweight Chat-app (Apps Script, Cloud Run, any HTTPS endpoint) that: • receives FORM_CHANGED / CARD_CLICKED,
    • reads comment from formInput,
    • replies with actionResponse.openLink.url = baseUrl + encodeURIComponent(comment).
    This is the standard pattern in the docs.

    B. If you can’t run any back-end, the only alternatives are: • Ask the user to copy/paste the comment into a second link (manual).
    • Or pre-populate the card with a generic “open Splunk” link that doesn’t include the comment.

    So, without involving a back-end Chat-app, a button whose URL changes according to the text-input value isn’t possible in Google Chat today.

  3. User

    add me a second button then | eval payload = "{ "cards": [ { "header": { "title": "Alert from Splunk" }, "sections": [ { "widgets": [ { "textParagraph": { "text": "An alert has been triggered. Click below to investigate." } }, { "buttons": [ { "textButton": { "text": "View in Splunk", "onClick": { "openLink": { "url": "https://your-splunk-instance/app/search/search?q=your-search-query" } } } } ] } ] } ] } ] }"

  4. Assistant

    Here’s the same card with two buttons in the same row.
    Just copy/paste (or adapt) the one-liner into your SPL alert search.

    | eval payload="{\"cards\":[{\"header\":{\"title\":\"Alert from Splunk\"},\"sections\":[{\"widgets\":[{\"textParagraph\":{\"text\":\"An alert has been triggered. Click below to investigate.\"}},{\"buttons\":[{\"textButton\":{\"text\":\"View in Splunk\",\"onClick\":{\"openLink\":{\"url\":\"https://your-splunk-instance/app/search/search?q=your-search-query\"}}}},{\"textButton\":{\"text\":\"Runbook\",\"onClick\":{\"openLink\":{\"url\":\"https://your-runbook-url\"}}}}]}]}]}]}"
    

    What changed? • Inside the same buttons array we added a second textButton object (named “Runbook” here—change text/URL as you like).
    • Because both buttons live in the same widget, Google Chat renders them side-by-side.

    Remember to keep the HTTP header:

    {"Content-Type": "application/json"}
    

    Now your alert card will show two clickable buttons next to each other. 👍

  5. User

    refactor me this to the spl splunk alert { "sections": [ { "widgets": [ { "textParagraph": { "text": "An alert has been triggered. Click below to investigate." } }, { "buttonList": { "buttons": [ { "text": "Odbieram", "type": "OUTLINED", "onClick": { "openLink": { "url": "https://your-splunk-instance/app/search/search?q=your-search-query" } } }, { "text": "Chcę skomentować", "type": "OUTLINED", "color": { "red": 0.1, "green": 0.1, "blue": 0.1, "alpha": 0.1 }, "onClick": { "openLink": { "url": "https://your-splunk-instance/app/search/search?q=your-search-query" } } } ] } } ] } ] }

  6. Assistant

    Below is the same card converted to the one-line, JSON-escaped string that Splunk expects in an eval statement.
    Just drop this search (or append it at the end of your alert search) and use the payload field as the POST body.

    | makeresults
    | eval payload="{\"cards\":[{\"sections\":[{\"widgets\":[{\"textParagraph\":{\"text\":\"An alert has been triggered. Click below to investigate.\"}},{\"buttonList\":{\"buttons\":[{\"text\":\"Odbieram\",\"type\":\"OUTLINED\",\"onClick\":{\"openLink\":{\"url\":\"https://your-splunk-instance/app/search/search?q=your-search-query\"}}},{\"text\":\"Chcę skomentować\",\"type\":\"OUTLINED\",\"color\":{\"red\":0.1,\"green\":0.1,\"blue\":0.1,\"alpha\":0.1},\"onClick\":{\"openLink\":{\"url\":\"https://your-splunk-instance/app/search/search?q=your-search-query\"}}}]}}]}]}]}"
    

    That’s it—Splunk will POST a Google-Chat card containing:

    • A text paragraph: “An alert has been triggered…”
    • Two OUTLINED buttons shown side-by-side:
    – “Odbieram” → opens the Splunk URL
    – “Chcę skomentować” (with a custom grey tint) → opens the same Splunk URL

    Keep your HTTP header set to

    {"Content-Type": "application/json"}
    

    Feel free to change the button texts, colors, or URLs; just edit the highlighted parts in the string.

  7. User

    Przerób mi to co jest po lewej tak aby pasowało do tego layoutu: | eval payload = "{ "cards": [ { "header": { "title": "Alert from Splunk" }, "sections": [ { "widgets": [ { "textParagraph": { "text": "An alert has been triggered. Click below to investigate." } }, { "buttons": [ { "textButton": { "text": "View in Splunk", "onClick": { "openLink": { "url": "https://your-splunk-instance/app/search/search?q=your-search-query" } } } } ] } ] } ] } ] }"

    zachowaj strukturę tego co wkleiłem, dodaj drugi przycisk i zmień nazwy

  8. Assistant

    Poniżej masz dokładnie tę samą strukturę (header → sections → widgets → textParagraph + buttons), tylko że w tablicy buttons znajdują się teraz dwa przyciski z nowymi nazwami.

    Skopiuj całą linię do SPL-a (np. na końcu alertu) i użyj pola payload jako body dla HTTP POST.

    | makeresults
    | eval payload="{\"cards\":[{\"header\":{\"title\":\"Alert from Splunk\"},\"sections\":[{\"widgets\":[{\"textParagraph\":{\"text\":\"An alert has been triggered. Click below to investigate.\"}},{\"buttons\":[{\"textButton\":{\"text\":\"Odbieram\",\"onClick\":{\"openLink\":{\"url\":\"https://your-splunk-instance/app/search/search?q=your-search-query\"}}}},{\"textButton\":{\"text\":\"Chcę skomentować\",\"onClick\":{\"openLink\":{\"url\":\"https://your-splunk-instance/app/search/search?q=your-search-query\"}}}}]}]}]}]}"
    

    Co zostało zmienione / dodane

    • W tablicy buttons są teraz dwa obiekty textButton. • pierwszy: "text": "Odbieram"
      • drugi : "text": "Chcę skomentować"
    • Oba przyciski otwierają ten sam przykład-URL; podmień je na docelowe linki, jeśli potrzeba.

    Nagłówek HTTP niezmienny:

    {"Content-Type": "application/json"}
    

    Gotowe – karta zachowuje Twój pierwotny layout, ale ma dwa przyciski z nowymi etykietami.

  9. User

    Przerób mi to co jest po lewej tak aby pasowało do tego layoutu: | eval payload = "{ "cards": [ { "header": { "title": "Alert from Splunk" }, "sections": [ { "widgets": [ { "textParagraph": { "text": "An alert has been triggered. Click below to investigate." } }, { "buttons": [ { "textButton": { "text": "View in Splunk", "onClick": { "openLink": { "url": "https://your-splunk-instance/app/search/search?q=your-search-query" } } } } ] } ] } ] } ] }"

    zachowaj strukturę tego co wkleiłem, dodaj drugi przycisk i zmień nazwy

  10. Assistant

    Poniżej masz ten sam układ (header → sections → widgets → textParagraph + buttons), tylko – podmieniłem napisy – dodałem drugi przycisk.

    Skopiuj jedną linię do SPL-a, a pole payload wykorzystaj jako body POST-a.

    | eval payload="{\"cards\":[{\"header\":{\"title\":\"Alert from Splunk\"},\"sections\":[{\"widgets\":[{\"textParagraph\":{\"text\":\"An alert has been triggered. Click below to investigate.\"}},{\"buttons\":[{\"textButton\":{\"text\":\"Odbieram\",\"onClick\":{\"openLink\":{\"url\":\"https://your-splunk-instance/app/search/search?q=your-search-query\"}}}},{\"textButton\":{\"text\":\"Chcę skomentować\",\"onClick\":{\"openLink\":{\"url\":\"https://your-splunk-instance/app/search/search?q=your-search-query\"}}}}]}]}]}]}"
    

    • Odbieram – pierwszy przycisk
    • Chcę skomentować – drugi przycisk

    Podmień oczywiście URL-e lub teksty według potrzeb.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.