Expand my Community achievements bar.

SOLVED

How to pass the ctx variable from js to page activity

Avatar

Level 2

Hi,

I am trying to pass the values from context variable called "playerPercentageData"  which contains this data.
<playerPercentageData>{"P2":"33%","P3":"11%","P6":"11%","P4":"22%","P1":"11%","P5":"11%"}</playerPercentageData>

I would like to send these percentage to the data progress value.

Akila4_0-1707729928324.png

Can anyone help on this ?

 

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi Akila,

You can pass the value to a variable like this and use a loop to populate.

 

var ppData = "<%=ctx.vars.playerPercentageData %>";

var valuesString = ppData.split(",");

 

Thanks

Bhartendu

View solution in original post

1 Reply

Avatar

Correct answer by
Employee

Hi Akila,

You can pass the value to a variable like this and use a loop to populate.

 

var ppData = "<%=ctx.vars.playerPercentageData %>";

var valuesString = ppData.split(",");

 

Thanks

Bhartendu