Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
amien
Specialist
Specialist

anyone got an example for me how to get a list of all Tables and Fields from an app in C#?

var fieldList = app.GetTablesAndKeys(null,null,0,false,false);

I tried something alike above, but it's not working

is there a better statement to get this info?

Thanks in advanced

1 Solution

Accepted Solutions
Øystein_Kolsrud
Employee
Employee

The data structures of the SDK map directly to the data structures used by the engine API. In this case the methods first two arguments are of type Qlik.Engine.Size‌, so to run the the following query (taken from the above example):

{ "jsonrpc": "2.0",

  "id": 1,

  "method": "GetTablesAndKeys",

  "handle": 1,

  "params": [

    { "qcx": 1000, "qcy": 1000 },

    { "qcx": 0, "qcy": 0 },

    30, true, false

  ]

}

You should run the following SDK operation:

var result = App.GetTablesAndKeys( new Size() { cx = 1000, cy = 1000 }

                                 , new Size() { cx = 0, cy = 0 }

                                 , 30, true, false

                                 );

The type of "result" will be a struct of type Qlik.Engine.GetTablesAndKeysResult which contains the two fields "tr" and "k" as shown in the response of the example. (All the leading 'q's are removed in the C# version, which is why you see the field "cx" and "cy" instead of "qcx" and "qcy" in C#.)

View solution in original post

4 Replies
Øystein_Kolsrud
Employee
Employee

You can check out this page. It's for the raw engine-API but maps quite easily to the C# world:

http://help.qlik.com/en-US/sense-developer/3.2/Subsystems/EngineAPI/Content/CreatingAppLoadingData/V...

amien
Specialist
Specialist
Author

Well . it's not quite easy for me .. can you give me some tips?

Øystein_Kolsrud
Employee
Employee

The data structures of the SDK map directly to the data structures used by the engine API. In this case the methods first two arguments are of type Qlik.Engine.Size‌, so to run the the following query (taken from the above example):

{ "jsonrpc": "2.0",

  "id": 1,

  "method": "GetTablesAndKeys",

  "handle": 1,

  "params": [

    { "qcx": 1000, "qcy": 1000 },

    { "qcx": 0, "qcy": 0 },

    30, true, false

  ]

}

You should run the following SDK operation:

var result = App.GetTablesAndKeys( new Size() { cx = 1000, cy = 1000 }

                                 , new Size() { cx = 0, cy = 0 }

                                 , 30, true, false

                                 );

The type of "result" will be a struct of type Qlik.Engine.GetTablesAndKeysResult which contains the two fields "tr" and "k" as shown in the response of the example. (All the leading 'q's are removed in the C# version, which is why you see the field "cx" and "cy" instead of "qcx" and "qcy" in C#.)

amien
Specialist
Specialist
Author

Got it working.. Thanks alot!