GitHub user dosubot[bot] added a comment to the discussion: request.json for 
alert/report

<!-- Answer -->
The `text` field being `null` is actually **expected behavior** for successful 
TEXT format notifications. In Superset's notification system, the [`text` field 
is only populated for error 
messages](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/reports/notifications/base.py#L26-L36),
 not for normal alerts.

For your proxy, you should construct the Mattermost message from the available 
fields:
- **`name`**: `"test8: Table"` - the alert/report name
- **`url`**: The link to explore the chart in Superset
- **`description`**: Will contain the report description if one was set (null 
in your case)

Based on [how Slack notifications construct 
messages](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/reports/notifications/slack_mixin.py#L63-L124),
 your proxy could build something like:

```python
payload = {
    "text": f"*{data['name']}*\n{data.get('description') or 
''}\n<{data['url']}|Explore in Superset>"
}
```

Note: If you need the actual chart data (the table content), that's stored in 
`embedded_data` as a pandas DataFrame internally, but it doesn't appear to be 
serialized in the webhook payload you're receiving. You may need a custom 
notification class to include that data.


<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*

---
<sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/8981bd2b-513f-47fd-a5ab-a7c1a4feabb1?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/8981bd2b-513f-47fd-a5ab-a7c1a4feabb1?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/8981bd2b-513f-47fd-a5ab-a7c1a4feabb1?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/8981bd2b-513f-47fd-a5ab-a7c1a4feabb1?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/8981bd2b-513f-47fd-a5ab-a7c1a4feabb1?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/8981bd2b-513f-47fd-a5ab-a7c1a4feabb1?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/8981bd2b-513f-47fd-a5ab-a7c1a4feabb1?feedback_type=other)</sup>

[![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20%60text%60%20field%20being%20%60null%60%20is%20actually%20%2A%2Aexpected%20behavior%2A%2A%20for%20successful%20TEXT%20format%20notifications.%20In%20Superset%27s%20notification%20system%2C%20the%20%5B%60text%60%20field%20is%20only%20populated%20for%20error%20messages%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/reports/notifications/base.py%23L26-L36%29%2C%20not%20for%20normal%20alerts.%0A%0AFor%20your%20proxy%2C%20you%20should%20construct%20the%20Mattermost%20message%20from%20the%20available%20fields%3A%0A-%20%2A%2A%60name%60%2A%2A%3A%20%60%22test8%3A%20Table%22%60%20-%20the%20alert/report%20name%0A-%20%2A%2A%60url%60%2A%2A%3A%20The%20link%20to%20explore%20the%20chart%20in%20Superset%0A-%20%2A
 
%2A%60description%60%2A%2A%3A%20Will%20contain%20the%20report%20description%20if%20one%20was%20set%20%28null%20in%20your%20case%29%0A%0ABased%20on%20%5Bhow%20Slack%20notifications%20construct%20messages%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/reports/notifications/slack_mixin.py%23L63-L124%29%2C%20your%20proxy%20could%20build%20something%20like%3A%0A%0A%60%60%60python%0Apayload%20%3D%20%7B%0A%20%20%20%20%22text%22%3A%20f%22%2A%7Bdata%5B%27name%27%5D%7D%2A%5Cn%7Bdata.get%28%27description%27%29%20or%20%27%27%7D%5Cn%3C%7Bdata%5B%27url%27%5D%7D%7CExplore%20in%20Superset%3E%22%0A%7D%0A%60%60%60%0A%0ANote%3A%20If%20you%20need%20the%20actual%20chart%20data%20%28the%20table%20content%29%2C%20that%27s%20stored%20in%20%60embedded_data%60%20as%20a%20pandas%20DataFrame%20internally%2C%20but%20it%20doesn%27t%20appear%20to%20be%20serialized%20in%20the%20webhook%20payload%20you%27re%20receiving.%20You%20may%20need%20a%20custom%20notification
 %20class%20to%20include%20that%20data.)&nbsp;[![Join 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/38427)

GitHub link: 
https://github.com/apache/superset/discussions/38427#discussioncomment-16005948

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to