Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rheinerrhenus
Contributor II
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.           






1 Solution

Accepted Solutions
Øystein_Kolsrud
Employee
Employee

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...

View solution in original post

2 Replies
Øystein_Kolsrud
Employee
Employee

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
Contributor II
Contributor II
Author

Thank you very much. That works perfectly.