How to carry data from one web app to another web app using a variable | Community
Skip to main content
Level 2
May 6, 2022
Solved

How to carry data from one web app to another web app using a variable

  • May 6, 2022
  • 1 reply
  • 3931 views

I am looking to carry data in a variable from one web app to another web app in Campaign classic v7. I am getting a language choice selected by the user and I am calling a second web app URL in the end activity of first web app. I have to access that variable in the second app to make a workflow.

I am actually setting the value once user selects into the recipient.@language using the document.controller.setValue but the recipient will not be persisted until the flow goes into second app. 

So how can I set the value into variable from the recipient.@language in the first web app and how can I send/access it in the second web app using either recipient.@language or the variable.

Any pointers for the syntax or how can I use it?

I have tried using document.controller.getValue to read the recipient, but didnt work.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Manoj_Kumar

Hello @sirikambampati 

 

Create a variable in the webApp properties and name it as language.

 

In the first page set the value of language with document.controller.setValue('/ctx/vars/language','VALUE');

 

On the second page of the webApp you can get this value by using this syntax.

<%= ctx.vars.language %>

1 reply

Manoj_Kumar
Community Advisor
Manoj_KumarCommunity AdvisorAccepted solution
Community Advisor
May 8, 2022

Hello @sirikambampati 

 

Create a variable in the webApp properties and name it as language.

 

In the first page set the value of language with document.controller.setValue('/ctx/vars/language','VALUE');

 

On the second page of the webApp you can get this value by using this syntax.

<%= ctx.vars.language %>
Manoj  | https://themartech.pro
Level 2
May 12, 2022

Hi @_manoj_kumar_ 

 

Thanks for the reply.

 

 document.controller.setValue('/ctx/vars/language','VALUE'); this worked and I have updated my language variable in the java script function of HTML page.

But I have to carry my variable to another web app which I am calling in the END activity of one web app.

So basically I want to use a Global variable which I can set in first web app and it should be there in ctx after my flow navigates to another webapp where I can use the global variable.

 

How can I achieve this in Campaign classic, to set a global variable?

 

TIA.

 

 

 

Manoj_Kumar
Community Advisor
Community Advisor
May 13, 2022

Hello @sirikambampati 

 

The context variables are global to a webApp they can be accessed in any of the activities within the same webapp.

 

Manoj  | https://themartech.pro