Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

rheinerrhenus
New Contributor II

Qlik .NET SDK - GetFieldList() does only return non-hidden fields

Hello Qlik Community,

this question goes especially to the C# developers that are using the Qlik .NET SDK.

We have created a simple C# tool that extracts the list of available fields of a given Qlik App

and stores them into an Excel-Sheet. This should later be used for internal documentation purposes.

So far we used the method GetFieldList() to receive a list of all fields and afterwards iterated over

each Item. Yesterday one of the tool users approached us and asked why the Excel sheet does

not contain the hidden fields. Long story short, we searched through the SDK documentation and

other sources and learned about the FieldListDef properties, in particular qShowHidden. But we don't
really know how to tell the API to do the FieldList request and consider qShowHidden = true.

So far we have something like this:

             FieldListProperties fieldListProperties = new FieldListProperties();

             fieldListProperties.Info = new NxInfo();

             fieldListProperties.Info.Id = "FieldList";

             fieldListProperties.Info.Type = "FieldList";

             fieldListProperties.FieldListDef = new FieldListDef();

             fieldListProperties.FieldListDef.Set("qShowHidden", true);

                  

             var fieldList = app.CreateGenericSessionObjectAsync<Qlik.Sense.Client.IFieldList>((AsyncHandle) null, new Func<Qlik.Engine.Communication.IO.Response, Qlik.Sense.Client.IFieldList>(AppExtensions.OnGetFieldListAsync()), fieldListProperties);

This actually does not compile, because Func needs some kind of pointer or so to an acutal method that reads the return

object out of the Response.

Any help solving this issue is appreciated. Thank you very much.           






Tags (1)
1 Solution

Accepted Solutions
Employee
Employee

Re: Qlik .NET SDK - GetFieldList() does only return non-hidden fields

I think it should be enough to set this value to true in the FieldList properties:

https://help.qlik.com/en-US/sense-developer/November2017/apis/net%20sdk/html/P_Qlik_Engine_FieldList...

So the code would look something like this:

var fieldList = app.GetFieldList();

using (fieldList.SuspendedLayout)

{

  fieldList.Properties.FieldListDef.ShowHidden = true;

}

var fields = fieldList.Items;

I haven't actually run the code though, so I could be mistaken...

2 Replies
Employee
Employee

Re: Qlik .NET SDK - GetFieldList() does only return non-hidden fields

I think it should be enough to set this value to true in the FieldList properties:

https://help.qlik.com/en-US/sense-developer/November2017/apis/net%20sdk/html/P_Qlik_Engine_FieldList...

So the code would look something like this:

var fieldList = app.GetFieldList();

using (fieldList.SuspendedLayout)

{

  fieldList.Properties.FieldListDef.ShowHidden = true;

}

var fields = fieldList.Items;

I haven't actually run the code though, so I could be mistaken...

rheinerrhenus
New Contributor II

Re: Qlik .NET SDK - GetFieldList() does only return non-hidden fields

Thank you very much. That works perfectly.

Community Browser