Check if Database List has no entry

Hi there,

I am trying to store a single variable to the local storage. To do that I first want to check whether the Database “LocalUser” is empty. If the Database is empty I want to create a new Database entry “New_localUser”.

So far I could not find a way to figure out whether “LocalUser” has an entry or not. Tried this in an IF condition: “IS_UNDEFINED(data.localUser[0].id)” . That always returns “true”, even if “data.localUser[0].id” exists.

Any ideas? Happy for any help.

Thank you,

Played around a bit and found a solution after trying out some things.

Maybe the solution helps somebody else out there: My problem was that I checked for a Data Variable right after App Start. I realised that Data Variables are filled asynchronous thus my variable was still empty at App Start. Solved the issue by adding an event-listener to the “Data Changed” event of the Data Variable which triggered the function flow.

1 Like