Sends a collection of field tags and/or summary tags to the application
example
This example is a basic field tag
import { FieldTag, TagPowers } from"@andi/powers";
import { FieldTagTypes, ISkillContext, ISkillActivity } from"andiskills";
import { CommercialLoanAccount } from"andiskills/lib/external/precisionLender/opportunity/OpportunityModels";
// this is main execution of the skill which is called after the andi// skills platforms determines if it should runexportasyncfunctionrun(skillContext: ISkillContext) : Promise<ISkillActivity> {
const event = skillContext.powers.andi.event.getApplicationEvent(skillContext);
const data = event.applicationEventData;
const cla: CommercialLoanAccount = data.engineModel.commercialLoanAccounts.find((cla) => {
return cla.id === data.contextId;
});
const fieldTag: FieldTag = {
fields: ["amount"],
text: "Congratulations you are pricing a loan",
tagType: FieldTagTypes.Info,
key: "uniqueTemplateKey",
//Andi should only load this field tag if the amount hasn't changedloadWhen: [{
query: { name: "getRawAmount", args: [] },
comparator: "==",
value: cla.amount,
type: "number"
}]
};
return TagPowers.sendTags([fieldTag]);
}
Sends a collection of field tags and/or summary tags to the application
This example is a basic field tag
import { FieldTag, TagPowers } from "@andi/powers"; import { FieldTagTypes, ISkillContext, ISkillActivity } from "andiskills"; import { CommercialLoanAccount } from "andiskills/lib/external/precisionLender/opportunity/OpportunityModels"; // this is main execution of the skill which is called after the andi // skills platforms determines if it should run export async function run(skillContext: ISkillContext) : Promise<ISkillActivity> { const event = skillContext.powers.andi.event.getApplicationEvent(skillContext); const data = event.applicationEventData; const cla: CommercialLoanAccount = data.engineModel.commercialLoanAccounts.find((cla) => { return cla.id === data.contextId; }); const fieldTag: FieldTag = { fields: ["amount"], text: "Congratulations you are pricing a loan", tagType: FieldTagTypes.Info, key: "uniqueTemplateKey", //Andi should only load this field tag if the amount hasn't changed loadWhen: [{ query: { name: "getRawAmount", args: [] }, comparator: "==", value: cla.amount, type: "number" }] }; return TagPowers.sendTags([fieldTag]); }