Got createDocument and replaceItemValue working