How to get modal value when close the modal on web sdk2

  • 12 August 2022
  • 3 replies
  • 92 views

Badge +2

Hi everyone

I have to get the input value when click the OK button.

I used this code on sdk v1, but it seems like .then() doesn’t work on sdk v2

Please let me know your ideas.

Thank you


3 replies

Userlevel 5

Hey Maxim - I would attach some logic to the onClick handler of the button, so that when you click “OK”, you read the value of the input 

Badge +2

@Addison Schultz 

Yeah you are right. It is possible to get the input value on setTagNameModal.html

so I stored the value in the metadata and have to get this on main.html

.then() doesn’t work on web sdk 2.0 I think

please let me know your thought

Userlevel 5

You’re working with quite a lot of nested then/promises. Are you able to work with async/await instead? 

Otherwise, you will need to include the async keyword in the first “then” call (the one right after you declare width/height (in the first line of the original screenshot you posted)

Reply