Hi @Rock Morin ,
Could you give this a try?
I found it on the Automation Anywhere GitHub page.
TableValue tableValue= new TableValue(); //AA table variable
Table table = new Table(); //normal table
.
//Add items to column schema
List<Schema> schemas = new ArrayList<Schema>();
for (Iteratoriterator = arrayWithColumnNames.getValues().iterator(); iterator.hasNext();)
{
StringValueheader = (StringValue) iterator.next();
Schema schema = new Schema();
schema.setName(header.get());
schemas.add(schema);
}
table.setSchema(schemas);
tableValue.set(table);
Kind Regards,
Ashwin A.K
.
Getting closer. I am getting an error instantiating the schema. The code compile but error is at runtime on this line:
Schema schema = new Schema();
I do have the following import:
import com.automationanywhere.botcommand.data.model.Schema;
The error I get is as follow:
Caused by: java.lang.ClassNotFoundException: com.automationanywhere.botcore.api.dto.AttributeType
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
This happens both in my test class and the bot action class
Getting same error as @Rock 9762 when trying to create a Schema object. Has anyone figured this one out?
Figured this one out. It appears you need to use newer AA360 SDK to create a Schema object, since the class was not provided in the earlier versions (i.e. 2.5.0). With 2.9.0 it works fine.