How to get the result after typing

In my country, we can use a postal code to obtain data regarding the location, such as the address, neighborhood, city and state.
For this, I use the web component. When the user enters the zip code (postal code), a web request is made and the data is retrieved in the text box.

If it is not found (error 401) I inform the user that they must go to the Correios website and obtain the necessary data.
As you can see, I’m using the lost focus textbox. As soon as it loses focus, the data is included.I’d like the response to appear after typing a short time, about 2 to 5 seconds. I was thinking about On text changed with clock.
Can anyone tell me how to do this?

Hi Carlos,

so you want the “get” to be executed a few seconds after the last text change, right?

edit:
if, so

What is the length of your postal code?

8 digits. Why?

Then you should count length first , if length is = or > 8 then call web

in the when text box text got changed, if the length of the text is = 8 then hide the keypaa then take get request and do not try to call every few sec the GET request.

I also added the 8-digit verification,

have you tried it?

1 Like

Good job guys!
It worked!

What is the use of clock here? Text changed event can handle it

You want only blocks and not suggestions???

Hi dear @Still-learning ,

Carlos wanted this

I didn’t add explanations because the blocks are really simple and he was already figuring it out on his own, I just gave a hand.

It would have triggered the get on every change of the TextBox not every 2-5 seconds

that is not fair for the project. if the zip code is 8 digit in length then what type of request the OP want to achieve? after getting the 8 digit only get request should take complete

So you would like to execute the GET only after the user has entered 8 digits, this would mean that every time the textbox contains 8, a GET is executed.

If the user has 7 digits and keeps adding and removing the eighth digit, GETs would be executed without delay.
By using a timer, even if the user performs a “bruteforce”, a delay is still applied which slows down the requests.

I hope I explained myself clearly