Do you have a relationship set up between the FeatureSet and the related table? If so, you can use this syntax to get the related records
var related = FeatureSetByRelationshipName($feature, "the relationship name");
If not, then you'll get the related records by filtering the table using the common field (relateField, in this example).
var relTable = FeatureSetByName($map,'table', ['*'], false);
var attribute = $feature.relateField;
var related = Filter(relTable, "relaterField = @attribute");
From that, filter the related records for the ones that need maintenance.
var records = Filter(related, "MaintenanceNeeded = 'True'");
if (Count(records) = 0) return "No maintenance needed";
var output = "Maintenance Needed: " + TextFormatting.NewLine;
for (var f in records) {
output += " " + f.MainenanceType + TextFormatting.NewLine;
}
return output;