How to Personalize the Workflow content into Alert Activity.

Avatar

Avatar
Boost 5
Level 2
ramprakasht3196
Level 2

Likes

9 likes

Total Posts

44 posts

Correct reply

0 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Boost 5
Level 2
ramprakasht3196
Level 2

Likes

9 likes

Total Posts

44 posts

Correct reply

0 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
ramprakasht3196
Level 2

01-10-2019

Hi,

I am trying to add the outbound transition content into alert activity for personalization. The image of workflow i added below. The alert activity is not populating the workflow content to the notification mails. In notification mail it sending only the text content present in alert activity not the content coming from previous activity. Below is the code iam using javascript activity as well alert actvity.

1838776_pastedImage_0.png

javascript activity code:

var query =xtk.queryDef.create (

<queryDef schema= "temp:query32" operation="select">

<select>

<node expr="@internalName"/>

<node expr="@lastStart" />

<node expr="@fullName" />

<node expr="@name" />

</select>

</queryDef>)

instance.vars.items = query.ExecuteQuery();

Alert Activity code:

<%

var items = new XML(instance.vars.items)

for each (var item in items){

%> 

<%= item.target.@fullName %>

<%= item.target.@internalName %>

<%= item.target.@lastStart %>

<%= item.target.@name %>

<%

} %>

Please help me to solve this issue. Thanks in advance.

Regards,

Ram.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Jean-Serge_Biro
MVP

03-10-2019

Hello Ram & Wesp,

Please have a look on factory ACC workflows using Alert activities, such as:

stockMgt

You will see how to pass the variables from Javascript part to Html part of the Alert activity (the same if the Javascript is done in a prior Javascript activity), it is a question of XML management for storage and reading in instance or event vars.

So in your case, do the same:

Javascript part:

var query = xtk.queryDef.create (

<queryDef schema= "temp:query" operation="select">

<select>

<node expr="@internalName"/>

<node expr="@lastStart" />

</select>

</queryDef>)

var itemsXML = query.ExecuteQuery();

vars.itemsXMLString = itemsXML.toXMLString()

HTML source part (with no format/presentation effort 😞

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD>

</HEAD>

<BODY>

<P><%= vars.recCount %></P>

<P>

<br/>

Workflows List Start:

<br/>

<%

var itemsXML = new XML(vars.itemsXMLString)

for each (var item in itemsXML){

%>

<%= item.@internalName %>

 

<%= item.@lastStart %>

<br/>

<%

} %>

<br/>

Workflows List End.

</P></BODY></HTML>

Regards
J-Serge

Answers (3)

Answers (3)

Avatar

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Jean-Serge_Biro
MVP

03-10-2019

One more thing:

Don't forget the other less clean solution, when the Javascript code is small like Ramprakasht's demand, you can put all the queryDef code inside the HTML source tab, so no XMLString() to do.
Well I do it sometimes, but I know, it is better to separate business logic and HTML format/presentation.

Regards
J-Serge

Avatar

Avatar
Validate 1
Level 2
wesp27904446
Level 2

Likes

12 likes

Total Posts

15 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
wesp27904446
Level 2

Likes

12 likes

Total Posts

15 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
wesp27904446
Level 2

01-10-2019

I've been having this same issue and have not yet figured it out.  Below is my previous post with a limited response...maybe you can figure this out from context where i could not:

Help: Adding work table content into a workflow alert

Avatar

Avatar
Validate 1
Level 2
wesp27904446
Level 2

Likes

12 likes

Total Posts

15 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
wesp27904446
Level 2

Likes

12 likes

Total Posts

15 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
wesp27904446
Level 2

03-10-2019

This worked perfectly.  Thank you!