While loop to check database

I still cannot get this to work with the same error message…
Type ‘Promise’ is not assignable to type ‘string’

I am going to try to find an alternative way.
Thanks again for your help