Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do I use variables on User Created Template?

Jacob Aicher December 17, 2019

I have created a User Created Template and am confused on how to enter a variable. I am seeing that at the top there is an option to InsertNew Variable. I can then name that variable and choose whether it is text, multi-line text, or a list. After I have created said variable, I'm confused on how to use that same variable in another place on the same template. There is no list to choose from my created variables on the template.

3 answers

1 accepted

0 votes
Answer accepted
Davin Studer
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.
December 17, 2019

Click on the variable in your template. Then hit ctrl+c to copy it and then ctrl+v to paste it wherever you want on the page. When you create a page with the template whatever you do with the variable it will be updated in both spots of the age.

Jacob Aicher December 18, 2019

Hi Davin - thanks for your message. I tried this out this morning and I am met with this error message. 

qwer1234.PNG

I made sure that their parameters are the same which is just Text. Any other ideas?

Davin Studer
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.
December 18, 2019

Hmmm. It works for me. I can save a template with variables that have the same name so long as the variable type is the same and in the case of a list the list options must be the same. I only see that error when two variables have the same name, but the params are not the same. Below is what it does for me.

What is looks like when I edit the template

image.png

What I see when I create a page based on the template. Changing either of the drop-downs changes them both.

image.png

Like Jacob Aicher likes this
Jacob Aicher December 18, 2019

Hey Davin - I've actually figured out the issue and this is a very interesting edge case. In my template, I am using a section with a table and the variable sits inside of the table. Then I use the same variable in another part of the template that is not inside of a table. What I have to do is go to the variable that sites in the table, edit it, then save it once more, then I am able to save my template and move forward. I'm wondering if the table is what is causing the issue. 

Like # people like this
Davin Studer
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.
December 18, 2019

Wow! Does sound like a weird bug. But glad you have a workaround.

Ammar Moughis January 19, 2020

Thanks Jacob, your workaround worked for me too. Classic confluence glitch.

Like Jacob Aicher likes this
0 votes
Christine_Sills January 30, 2020

Looks like it only allows the copy/paste and using same variable multiple times if it's a "List" select.  I'd like to be able to input anything into the first place then re-use like we used to in the older version you could do the $variable but we lost that :(

Ruiqing Liang February 2, 2020

Please see Jacob Aicher's workaround - click Edit and Save the variable without making changes and then save the template again.  At least that works for me. Thanks @Jacob Aicher.

 

What I found out is that if you have repeated the variable multiple times, you will have to find the first occurrence and then Edit & Save the variable, then your template will be good to go.

 

@Davin Studeris there any chance for Atlassian to fix this defect? It is really stopping people to create/update user template, because user has to confirm the variable(s) by Edit&Save them every time you open the template,

Davin Studer
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.
February 3, 2020

@Ruiqing Liang I've created a bug report for this issue with steps to reproduce it. So hopefully they will fix it soon.

Like # people like this
Davin Studer
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.
February 5, 2020

There is a bug ticket for this in Atlassian's Jira project for Confluence Cloud. You can add yourself to the Affected customers by clicking the "This affects my team" link on the page.

CONFCLOUD-67845

0 votes
tbellmr December 17, 2019

I have not tested this but seems like I just saw this on a video recently.  You create a variable call it $x and assign its initial value in the first instance it is used.

Let's say down a paragraph or two you simply use $x and that should resolve to what you entered above.  Not tried this but that is what I think you need.  Best of luck!

Jacob Aicher December 17, 2019

Hey there. Thanks for the feedback. This is how it used to work for me when using the $ sign however, this is no longer the shortcut to bring up a variable. Rather I have to go to the top bar and select New Variable. I've added a screenshot below to help. 

ffddssaa.PNG

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events