Hi All,
Looking for some guidance as I’m well outside my basic scripting depth.
Use case: I have a table of applicants each linked to a group. The groups are listed out in another table and then all the group’s applicants linked in the “group members” field. Each applicant has a field that I would like to compile into a list and email or display with markdown formatting. The goal is that I have a button on the Groups table that allows a user to “generate list” which outputs or emails them the formatted list of the 5-6 group members that can then be copied into an email.
Where I’m stuck is I am able to get as far as building an array of the ids for the linked applicants, but don’t know how to then use that array to retrieve the individual field values for each applicant from the applicants table.
Script so far is below. Also thanks to those whose scripts I already borrowed/mutilated to get this far.
This script is born because the field I’m trying to pull out is a custom hyperlink and while stored in a long text field with RTF, it’s not copy and paste-able into an email client. We also can’t create templates for the emails, otherwise I would have it compiled into an email and sent.
Thank you in advance for the help!
-Kyle
//Script exports formatted listing of group participants to use in follow-up email
let linkedTable = base.getTable('Peer Group Applications');
let rootTable = base.getTable('Groups');
//script is initiated from the group on the "groups" table
let group = await input.recordAsync('Choose a record', rootTable);
let cellValue = group.getCellValue('Name');
output.text(`You have selected: ${group.name}`);
//Generate array of linked applicants for the selected group
let linkedQuery = await linkedTable.selectRecordsAsync();
let linkedRecordIds = (group.getCellValue('Group Members')).map(linkedRecord => linkedRecord.id);
//Use each id and return the "Linked Role and Company" field from the "applicants" table
//Output of group ids for testing
output.table(
linkedRecordIds
);




