Skip to main content
Answered

How to make input required before action component in canvas-kit


I am building a custom app in messenger home. It will open a form asking user input and submit. I wonder if there is any built-in method to make interaction component required (input, text area, select etc) before the user hit action component (button).

Also, my app will stay at the submit flow after the user interaction. Is anyway I can reset the UI back to initialize flow?

Best answer by Jacob Cox

Hi @Mizuha !

If you want to make sure a user includes a value in an input field, you could add note in the text letting them know that it’s required and render the button disabled unless they’ve included text there. You could also wait for them to submit the form and verify that the fields have values on the backend. If they don’t you can return a canvas that asks them to retry with all of the fields filled.

Our Canvas Kit docs discuss the circular flow of information from intializing, to submit, to (possibly) a sheet, back to initialization. I would recommend reading over our docs on the subject here.

View original
Did this topic help you find an answer to your question?

2 replies

Jacob Cox
Intercom Team
Forum|alt.badge.img+5
  • Sr. Technical Support Engineer
  • 441 replies
  • Answer
  • November 12, 2023

Hi @Mizuha !

If you want to make sure a user includes a value in an input field, you could add note in the text letting them know that it’s required and render the button disabled unless they’ve included text there. You could also wait for them to submit the form and verify that the fields have values on the backend. If they don’t you can return a canvas that asks them to retry with all of the fields filled.

Our Canvas Kit docs discuss the circular flow of information from intializing, to submit, to (possibly) a sheet, back to initialization. I would recommend reading over our docs on the subject here.


  • Author
  • New Participant
  • 1 reply
  • November 13, 2023

Hi @Jacob Cox 

Thank you for help. The last step of my app submit flow will render a button (URL action) to redirect the user to a url. This action will not trigger the submit flow anymore. In this case, how do I return the user back to the initialize flow?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings