Passing WHERE Clause parameters to a Table Lookup Data Reference through AFSDK

Discussion created by buse on May 22, 2014
Latest reply on May 22, 2014 by buse



I am trying to evaluate the value of an AF Attribute that implements the Table Lookup Data Reference given the WHERE Clause Parameter(s).


For example, having an attribute configured as follows:




I need to write a function with the following signiture:

double EvaluateAttrLookup(AFElement elm, int id){} 

 I am accomplishing this requirement for a Formula Data Reference using code similar to the following:

double EvaluateAttrFormula( AFElement elm, double a, double b)
    //get the attribute
    AFAttribute attrFormula = elm.Attributes["AttrFormula"];
    //get the data reference
    AFDataReference afDrFormula = attrFormula.DataReference;
    //get the inputs to the formula
    AFAttributeList inputsFormula = afDrFormula.GetInputs(null);
    //specify the input values
    AFValues valsFormula = new AFValues { new AFValue(a), new AFValue(b) };
    return (double)afDrFormula.GetValue(null, null, inputsFormula, valsFormula).Value;

  However, this approach did not work for the Table Lookup Data Reference, as the GetInputs function returned an empty AFAttributeList.


Is there a way to accomplish the requirement without having to parse the query string for a Table Lookup Data Reference?


Thank you!