I am trying to pass in the Label Annotations from a Google Vision connected system into an editable grid. When I use the attached code, fv!item.description and fv!item.score returns the data as a single list of string as opposed to the 10 independent dictionary items. How can I correct this?
rows: { a!forEach( items: local!gvLabels, expression: a!gridRowLayout( contents: { a!textField( value: fv!item.description ), a!textField( value: fv!item.score ) } ) ) },
Discussion posts and replies are publicly visible
try:
local!gvLabels.description[fv!item]
Doesn't seem to do anything. Tried fv!index as well, which successfully returns the first value from the list of values making me even more confused. Apparently it understands that this is a dictionary but fails to index out the list correctly when in a!forEach.
It's interesting to me that it's recognized as a dictionary but the usual functions are failing. Could you potentially try splitting the output inside the forEach, and then taking the index at that point?
so instead of fv!item.description its split(fv!item.description, ", ")[fv!index]