How to get a dataview from a page using the Mendix Model SDK?

0
I'm using the Mendix Model SDK to automate some tasks. In my Studio Pro project I have a page MyFirstModule.Home. This page has a dataview . I want to get this dataview through the SDK, currently I'm able to get to the page but it seems there's no apparent way to get to the dataview through the SDK, although according to the documentation there is such a class as dataviewsource from the page object, unless I'm understanding the documentation incorrectly.   This is my code for getting the page, but I'm not sure exactly how to get to the dataview(s) in that page: import { MendixPlatformClient, setPlatformConfig } from "mendixplatformsdk"; const client = new MendixPlatformClient(); const app = client.getApp(appID); const branchName = await getBranchName(branchParam, app); const workingCopy = await app.createTemporaryWorkingCopy(branchName); const model = await workingCopy.openModel(); const page = model.findPageByQualifiedName( "MyFirstModule.Home" ); const loadedPage = await page?.load(); console.log(page); console.log(loadedPage); //don't know how to get dataviewsource from the loadedPage/page variable.  
asked
1 answers
4

Solved this issue by using the 

 JavaScriptSerializer.serializeToJs(model);

function.

 

This function will expose the JS code that builds the page, and from the code you can lookup what ever you need to in that page.

 

If anyone stumbles upon this problem and doesn't understand the answer I've given, let me know then I'll answer expand more on it.

answered