Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
I think it should be enough to set this value to true in the FieldList properties:
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...
I think it should be enough to set this value to true in the FieldList properties:
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...
Thank you very much. That works perfectly.