I’ve tried a bunch of things and have failed to figure this thing out. Maybe that’s only the Friday talking.
This is from a customization layer on a Kinetic dashboard and BAQ results.
In a kinetic-function widget, I can pass along the contents of a dataview inside the method parameters field value to the string parameter inJson like this:
I get an error passing that into the function, I’m guessing because it’s an object and not a string at this point
I’ve tried a number of variations on JSON.stringify() including something like this: JSON.stringify({xxxProcessingDV}) but get errors on that. I’ve tried stuffing this into TransView.SerializedData but the row-update fails.
There’s only three rows of data here, so I don’t think it’s a size thing.
It would be cool if I could just pass the dataview contents to a BAQ tableset parameter on the function side, but that’s just getting greedy, I think.
Anyone have an easy way to do this, or a hard way that works?
//Create a list iterate through
var selectedLines = input.Tables["DV_BAQ_TestABC"].AsEnumerable()
.Where(x => x.Field<bool?>("Calculated_IsSelected") == true)
.Select(x => new
{
ABCCode = x.Field<string>("ABCCode_ABCCode"),
CountFreq = x.Field<double>("ABCCode_CountFreq"),
})
.ToList();
I did use a selector in this example, although not necessary. Interestingly attempting add a selector field to the columns seemed to break the execution of the baq in the dashboard, so ended up adding the Calculated_Selected field in the BAQ.
// Return the result
var formattedLines = selectedLines.Select(x => $"{x.ABCCode} / {x.CountFreq}");
var rowIdList = "Abc Code / Count Freq" + Environment.NewLine + string.Join(Environment.NewLine, formattedLines);
output = $"{rowIdList}{Environment.NewLine}";