Skip to content
TheChatArchiveThe Chat Archive
Mistralmagistral-medium-2506· Mistral AIHugging Face LMArena Human Preference 140K

how it comes that two buttons are not recognized correctly by google chats even though…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with gpt-4.1-mini-2025-04-14’s answer.
  1. User

    how it comes that two buttons are not recognized correctly by google chats even though they are in designer app one button is woking properly. Can you prepare a refactor which will work?

  2. Mistral Assistant

    The issue is likely due to the structure of the buttons array in your JSON payload. Google Chat expects buttons to be in a specific format. Let me provide a corrected version that should work properly in Google Chat:

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

    Key Fixes:

    1. Changed from "buttons": [{"textButton": {...}}] to the correct format "buttonList": {"buttons": [...]}
    2. Simplified the button structure to match Google Chat's expected format
    3. Removed the type field (Google Chat buttons don't use this property)
    4. Removed the color field (Google Chat buttons don't support this property)

    Alternative Format (if the above doesn't work):

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

    If neither of these work, please let me know what specific issue you're seeing with the buttons in Google Chat. Are both buttons appearing but only one works? Or is one button not appearing at all? This will help me provide a more targeted solution.

  3. User

    can you add something to the splunk url to open a dashboard and scroll down on entry?

  4. Mistral Assistant

    To open a Splunk dashboard and scroll to a specific section, you'll need to modify the URL to include both the dashboard path and a fragment identifier (for scrolling). Here's how to do it:

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

    Key Changes for the Dashboard URL:

    1. Dashboard URL Structure:

      https://your-splunk-instance/en-US/app/your-app-name/dashboard-name
      
    2. To scroll to a specific section:

      • Add #section-id at the end of the URL (replace section-id with your actual section ID)
      • For panels with IDs, use #panel-id
    3. To expand a specific section:

      • Add ?form.sectionId=your-section-id to the URL

    Example with Both Features:

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

    How to Find Section IDs:

    1. Open your dashboard in Splunk
    2. Right-click on the section/panel you want to scroll to
    3. Select "Inspect" (in Chrome) or "Inspect Element" (in Firefox)
    4. Look for data-panel-id or id attributes in the HTML

    Alternative Approach:

    If you want to scroll to a specific time range in a search, you can use:

    https://your-splunk-instance/app/search/search?q=your-search-query&earliest=-15m&latest=now
    

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