Hi everyone, does someone know why these function ...
# community-help
f
Hi everyone, does someone know why these function
STORY_RUN_GUID()
and
STORY_RUN_GUID()
always return empty when I call them ? I'm trying to use them the in the Webhook response body.
m
I think they only get created when an event is emitted, which only happens after the response has been returned. We may be able to change this, but i'm 99% confident that's how it works now
f
It' could be really great to have possibility to return it back. It could act as a reference of the submission for debug.
r
Hacky, but if you set the response body to blank, no response will be sent. You can then use a HTTP Action to respond to the webhook response URL in a later action which will contain the story_run_guid πŸ™‚
f
But, the behavior (empty) is also the same in the other actions. I tried to send the story link in the last action (email)
You can then use a HTTP Action to respond to the webhook response URL in a later action
How can we do that ? Any exemple ?
m
just to confirm @flat-kitchen-56993 - when you're sending a story run guid in an email is it working? it won't work in a dry-run, but should if you actually run the action?
can you share more about what you're trying to achieve so we can think of other ways around it?
would generating a random integer/string/uuid work? e.g. using
UUID()
in the response?
f
when you're sending a story run guid in an email is it working?
Yes. it's working now πŸ™‚ But here is what i'm have implemented so far : 1. A Slack view Opened after slash command (via tines webhook) 2. After submission (same webhook), I perform some transformation to test the logical validity of the request. 3. Wen it failing I sending a email to the submitter to aknowledge the request was rejected. (And now the story run guid is well set) What I would like to make as improvement, is to give more quick feed to the submitter in Slack directly: by sending back the stoty guid via the webhook response (submission)
m
yep - i totally understand the use case! makes a ton of sense!
thanks for sharing this Moustapha!
f
Also, thinking about the design. It would be also super helpfull to create a new option in the webbook that delay the http response (with a timeout setting). then have the possibility to link back a down action's data as response (another event). Something like :
Copy code
{
  "async_response": {
    "timeout": 10,
    "complete_with": "event-of-action-name-or-id"
  }
}
Offering a way to enrich the webhook response with downstream action event data... My 2 cents πŸ™‚
This is typically what I would like to implement https://api.slack.com/surfaces/modals/using#displaying_errors But only possible if we can send back a payload as a response to the post on the webhook (but those checks are done in the others actions...)