Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Mauritz_SA
Partner - Specialist
Partner - Specialist

Get app data model using API

Hi everyone

Is there any way to get the data model of an app using the REST APIs? I am currently working with PostMan. I would like to pass it the app id and get a response with the tables, their fields and the key's between different tables if possible.

Please let me know if anything is unclear and I'll gladly elaborate.

Regards,

Mauritz

1 Solution

Accepted Solutions
NadiaB
Support
Support

Hi @Mauritz_SA 

If the only information you are looking for is the final data model of the app, the following endpoint can be used:

http(s)://{server}/api/v1/apps/{GUID}/data/metadata

this is the same point used for the App Metadata Analyzer , https://help.qlik.com/en-US/sense-admin/May2022/Subsystems/DeployAdministerQSE/Content/Sense_DeployA...

Let us know if you have any questions. 

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm

View solution in original post

5 Replies
hrigner
Employee
Employee

Hi Mauritz,

If you just want to explore/validate the data model you can use catwalk , a tool very useful when you want to explore your data model for whatever reason. It's open source,  and the source code can be found on GitHub .

It might however not be the answer to your question, depending on what you want the data model for. 🙂

Best Regards,

Helene

Mauritz_SA
Partner - Specialist
Partner - Specialist
Author

Hi Helene

Thanks so much for the feedback. We have an OEM solution where we have a stream per client and a standard app which is published to all clients. We have many fields available in the QVDs (data layer) that can get loaded, but what is important to one is not necessarily to another. My idea is to have the full possible data model in a main app (template/standard app) and then having the clients select which fields they want in their version of the published app. We are already doing this using Excel files, but this is obviously not scalable as we need to update all of the Excel files when adding a field. We are now moving this to an external application (rather than Excel files). I would ideally like to extract the QS template app's data model using the external application. I can then use this to populate the choices that we expose to the client dynamically, rather than having to update the choices manually.

I'll have a look at Catwalk to see what they do :).

Maybe someone else has an easy example that I can piggy back off.

Regards,

Mauritz

christopherkramer
Partner - Contributor III
Partner - Contributor III

Hi,

I had the same question and here is what I found out:

The API that catwalk uses is

const datamodel = await doc.getTablesAndKeys({}, {}, 0, true, false);
const tables = datamodel.qtr;

See https://github.com/qlik-oss/catwalk/blob/master/src/components/model.jsx#L30

 

API documentation of getTablesAndKeys:

JSON API: https://help.qlik.com/en-US/sense-developer/August2022/Subsystems/EngineJSONAPI/Content/service-doc-...

.NET: https://help.qlik.com/en-us/sense/1.1/apis/net%20sdk/html/M_Qlik_Engine_App_GetTablesAndKeys.htm

Here is an example for the JSON API:

https://help.qlik.com/en-US/sense-developer/May2021/Subsystems/EngineAPI/Content/Sense_EngineAPI/Cre...

Hope this helps someone with the same question.

NadiaB
Support
Support

Hi @Mauritz_SA 

If the only information you are looking for is the final data model of the app, the following endpoint can be used:

http(s)://{server}/api/v1/apps/{GUID}/data/metadata

this is the same point used for the App Metadata Analyzer , https://help.qlik.com/en-US/sense-admin/May2022/Subsystems/DeployAdministerQSE/Content/Sense_DeployA...

Let us know if you have any questions. 

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
Mauritz_SA
Partner - Specialist
Partner - Specialist
Author

Thank you @NadiaB and @christopherkramer !