Below is the code from TCML_QueryInterface, any thoughts why I am getting this error?
load( local!query, local!result, local!summary, local!desc, local!prediction, local!modelId: cons!TCML_modelId, local!listOfModelIds: rule!TCML_getTrainedModels().modelId, { a!columnsLayout( columns: { a!columnLayout( contents: { a!paragraphField( label: "What is Text Classification?", value: "Text Classification using Machine Learning is the ability to classify a sentence, paragraph or document of text to a certain category.
For example, if we have a set of articles, we can classify them as 'Medical Articles', 'Business Articles', and 'Technology Articles'.", readOnly: true ), a!imageField( label: "", labelPosition: "ABOVE", images: { a!documentImage( document: cons!TCML_Text_Classification ) }, size: "LARGE", isThumbnail: false, style: "STANDARD" ) } ), a!columnLayout( contents: { if( length( /* For some reason, the Google API sometimes doesn't return the list of trained model ids If so, let's just use the last saved trained model id. */ local!listOfModelIds ) > 0, a!dropdownField( label: "Selected a Trained Model", labelPosition: "ABOVE", placeholderLabel: "--- Select a Value ---", choiceLabels: rule!TCML_getTrainedModels().displayName, choiceValues: rule!TCML_getTrainedModels().modelId, value: local!modelId, saveInto: local!modelId ), {} ), a!paragraphField( label: "Text to classify", labelPosition: "ABOVE", instructions: "", helptooltip: "", placeholder: "Enter text like ""The stock market closed at a record high.""", value: local!query, saveInto: local!query, refreshAfter: "UNFOCUS", validations: {} ), a!buttonArrayLayout( buttons: { a!buttonWidget( label: "Classify", saveInto: { a!save( local!prediction, rule!TCML_predictTextCategoryAutoML_CS( local!modelId, local!query ).result ) }, style: "NORMAL" ) }, align: "START" ), a!gridField( label: "Predictions", labelPosition: "ABOVE", data: local!prediction.predictions, columns: { a!gridColumn( label: "Category", value: fv!row.label ), a!gridColumn( label: "Score", sortField: "score", value: fv!row.score ) }, initialsorts: { a!sortInfo( field: "sort" ) }, validations: {} ) } ) } ) })
Discussion posts and replies are publicly visible
Hi vinayp0001,
Some times rule!TCML_getTrainedModels() might return a null value or while using local variable it will consider the data type as list of a variant. So instead of dot operator, you can use the index here.
Instead of "rule!TCML_getTrainedModels().modelId" can you use Index(rule!TCML_getTrainedModels(),"modelId",null()) and try now?
Reference link for similar issue:https://community.appian.com/discussions/f/user-interface/17993/invalid-index-cannot-index-property-identifier-of-type-string-into-type-list-of-variant
What is the output of rule!TCML_getTrainedModels()? In your interface you're directly referencing a dot property, ".modelId", from the output of this rule, but the error message suggests that the rule is either returning an empty set or perhaps a data set that doesn't have ".modelId" directly.
As an aside, I notice you're calling that rule 3 separate times in your interface - once to get ".modelId" for a load variable, and then twice in your dropdown definition (once for displayName and once for modelId again). This might not impact performance if the rule is just returning a static data set, but if it's doing any sort of query then it would be far better to load the whole set into a local variable and just refer to that further down in your interface.