Python-slack-sdk: Closing Modal after submission on AWS Lambda

Created on 30 Oct 2020  路  4Comments  路  Source: slackapi/python-slack-sdk

Hey all, I'm having trouble closing a modal after the user submits the view. My code is in AWS Lambda and I have already tried several iterations of returning 200's with empty bodies, as per the documentation, but nothing seems to close the modal.

Am I missing something?

Screen Shot 2020-10-30 at 1 15 55 PM

question

Most helpful comment

Hi @tinoargentino, thanks for using this SDK!

I'm also not sure why your code didn't work and the current version works so far yet. As you may know, response_action: clear is a bit different operation. If you're fine to try our another library built on top of this SDK - Bolt, implementing this type of apps should be much easier.
https://github.com/slackapi/bolt-python/blob/v0.9.6b0/examples/aws_lambda/aws_lambda.py

If you have questions with Bolt, please feel free to post it to the project's issue tracker.
https://github.com/slackapi/bolt-python/issues

All 4 comments

I was able to solve this, though I'm not sure how or why. I solved it by changing my return statement in the AWS Lambda for the following:

returnobject={
    "statusCode": 200,
    "headers": {
        "Content-Type": "application/json"
    },
    "body": "",
    "response_action": "clear"
}
return returnobject

If anybody can explain why this works I would appreciate it a lot

Hi @tinoargentino, thanks for using this SDK!

I'm also not sure why your code didn't work and the current version works so far yet. As you may know, response_action: clear is a bit different operation. If you're fine to try our another library built on top of this SDK - Bolt, implementing this type of apps should be much easier.
https://github.com/slackapi/bolt-python/blob/v0.9.6b0/examples/aws_lambda/aws_lambda.py

If you have questions with Bolt, please feel free to post it to the project's issue tracker.
https://github.com/slackapi/bolt-python/issues

Thanks once again Seratch. My project is finished for now but I'll have this in mind.

Thanks for your reply! Let me close this issue now but please feel free to write in or reopen as necessary.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Dwyte picture Dwyte  路  3Comments

kompotkot picture kompotkot  路  4Comments

seratch picture seratch  路  3Comments

charlesreid1 picture charlesreid1  路  3Comments

schlegelp picture schlegelp  路  3Comments