Why is the variable content not shown the first time?

Two variables are filled but are not shown in the first interaction of the app.
1- After scanning a QR CODE, I call the procedure BUSCANOMES;
2- In BUSCANOMES I call the POST method of the WEB component;
3- After the execution, I take the JSON content and keep it in 2 variables.
4- Check if the 2 variables are empty.
5- I will show the Dialog if they are filled.
And the DIALOG is shown without the contents of the variables. CANCEL key, and repeat the routine; And then the DIALOG is shown with the variables.
It seems that the call to PROCEDURE and the DIALOG display occur simultaneously. Is that it?

Because the web component works asynchronously