Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

'Submit To' Based on Number in Table Cell

Avatar

Former Community Member

Hi,

Upon clicking a Submit button, I'm trying to have my form go to certain people based on a number in a table cell.

For example, if the dollar amount in the table cell I named "TotalPrice" is $1,000 or greater, it goes to one group, and if it is less than $1,000, it goes to another group.

Here is the script I was trying, but not having any success...

var vEmail;

var vCC;

if (Page1.Table1.Row[11].TotalPrice.rawValue >= 1000)

{

    vEmail = Page1.Buyer.rawValue;

    vCC = Page1.RequestorEmail.rawValue + "person@company.com";

}

else

{

    vEmail = Page1.Buyer.rawValue;
    vCC = Page1.RequestorEmail.rawValue;
}

Any advice would be appreciated.

Regards,

ZeroZone

1 Accepted Solution

Avatar

Correct answer by
Level 8

var vEmail;

var vCC;

if (Page1.Table1.Row.all.item(11).TotalPrice.rawValue >= 1000)

{

    vEmail = Page1.Buyer.rawValue;

    vCC = Page1.RequestorEmail.rawValue + ";anotherperson@company.com";//make sure to separate emails with semicolons(;)

}

else

{

    vEmail = Page1.Buyer.rawValue+";whoeverelse@company.com";

    vCC = Page1.RequestorEmail.rawValue;

}

app.mailMsg({bUI:true,cTo:vEmail,cSubject:"My Subject",cCC:vCC})

Kyle

View solution in original post

2 Replies

Avatar

Correct answer by
Level 8

var vEmail;

var vCC;

if (Page1.Table1.Row.all.item(11).TotalPrice.rawValue >= 1000)

{

    vEmail = Page1.Buyer.rawValue;

    vCC = Page1.RequestorEmail.rawValue + ";anotherperson@company.com";//make sure to separate emails with semicolons(;)

}

else

{

    vEmail = Page1.Buyer.rawValue+";whoeverelse@company.com";

    vCC = Page1.RequestorEmail.rawValue;

}

app.mailMsg({bUI:true,cTo:vEmail,cSubject:"My Subject",cCC:vCC})

Kyle