...
Now that we have a list of structs we can map them to one of the fields.
Code Block |
---|
string [] attachmentsCreatedToday; for(string a in attachments) { string [] file = fileInfo(getAttachmentPath(key, a)); date created = parseDate("yyyy-MM-dd hh:mm:ss", file["created"]); if(created > startOfDay(currentDate())) { attachmentsCreatedToday += a; } } return attachmentsCreatedToday;toys = arrayStructMap(toys, "name"); //mapping each array element to the name field return toys["Bouncy Ball"].color; //element can be retrieved by name now that is has been mapped |
Result: "Blue"
See also
Filter by label (Content by label) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|