I do not know the answer to your question, but for everyone else out there I did you the favor of “properly” indenting your code. The code you posted is very difficult to read with the indentation you use.
--search bar function to find user local function onSearchUser( ok, res, info ) if (ok == true) then for key, value in ipairs( res.results ) do if (value.username == searchInput.text) then -- user found! print("USER FOUND!") print( "Push notification target is: "..searchInput.text ) gamesettings.pushNotificationTarget = ""..searchInput.text loadsave.saveTable(gamesettings, "settings.json") else native.showAlert( "No User Found", searchInput.text.." does not exist!", { "" } ) end end end end --search parse database for user by username parse.macro.findUserByUsername( ''..searchInput.text) :response(onSearchUser)