Scroll to element


does anybody know how appium can scroll to an element in a native app?
I am using the IOSDriver for the iOS App and the AndroidDriver for the android App.

My code:
RemoteWebElement element = (RemoteWebElement)driver.findElement(By.Id(“Some Id“));
String elementID = element.getId();
HashMap<String, String> scrollObject = new HashMap<String, String>();
scrollObject.put(“element”, elementID);
scrollObject.put(“direction”, “down”);
driver.executeScript(“mobile:scroll”, scrollObject);

If i execute this code i get a NoSuchElementException.
Please help.