Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Read {list-data} and assign value to a variable.

Stefan Eike
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 2, 2012

I do really feel ashame asking this noobish question, 'cause the answer will be self-evident, but I couldn't get it and wastet more than an hour ...

I'm developing users macros and space templates. Somewhere in my template is a {list-data}. I want to display the value of the selected option (in this case o1 or o2) somewhere else on the same page and assign it to a variable.

{list-data:mylistdata|type=select|multiple=false|required=true|blank=true|width=100%}
{list-option:value=o1}Option 1{list-option}
{list-option:value=o2}Option 2{list-option}
{list-data}

Do I really have to use a macro like {report-info} or something similar?

1 answer

1 accepted

1 vote
Answer accepted
Thomas Schlegel
Community Champion
July 2, 2012

Hi Stefan,

just type:

{get-data:mylistdata}Default value{get-data}

Cheers

Thomas

Stefan Eike
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 2, 2012

Thank you Thomas-S. Do you have an idea, if and how I can assign the return value to a variable? Or if and how I can add the value as a label using {add-label}?

Stefan Eike
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 2, 2012

^^ That's it!

Stefan Eike
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 2, 2012

{replace-and-render}
{replace-item:%mynewlabel%}{get-data:mylistdata}{replace-item}
{replace-body}{add-label:%mynewlabel%}{replace-body}
{replace-and-render}

Stefan Eike
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 2, 2012

Ok, I can add is as a lable, but this is not working, if the return value contains free spaces. So I have to do some stuff with the return value. Therefore I need it in a variable. This does not work:

{replace-and-render}
{replace-item:%mynewlabel%}{get-data:mylistdata}{replace-item}
{replace-body}
%mynewlabel%
{replace-body}
{replace-and-render}

And ideas?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events