Action on null DB .. in sketchware

134 Views Asked by At

I'm using sketchware. I just want to know how to do an action if the dataSnapshot return null.

I'm using this method to call my data from the db on child added and on child changed

Adder_Name = _dataSnapshot.child(Personal_ID).child("01)اسم_المضيف").getValue().toString();

I set the data to a string variable then set the textveiw to it, in this case "Adder_Name" is the variable

If the Personal_ID or "01)اسم_المضيف" does not exist in my db, how to do an action then?

1

There are 1 best solutions below

0
On

use block length of (listmap).

If length =0 then, its null.

perform action accordingly.