I am doing intercansiter call using a candid interface and it seems like it wants me to produce a record without a named variable … I hav abstracted a use case here to define what I think I need to do?
type MyType = {
varName1 :Text;
varName2 :Text;
};
public func showRecord() : async MyType {
// mo code to populate:
var myNewVar : MyType = {
varName1 = "banana";
varName2 = "orange";
};
return myNewVar ;
} ; // end showRecord
From the candid side, record always has field names, but if the field name is numbered consecutively starting from 0, we can omit the field name as a shorthand. So record { 0 : text; 1 : text} can be written as record { text; text }. In Motoko, this type maps to tuple. For example,