Is it possible to declare and use a variable in a table in confluence?
Asked by Vincent:

Hi Folks,

After I didn't find answer I take the opportunity to post here\^\^

I would like to know if it's possible to declare a variable and use it in a confluence table.

example:

* on column 1 there is a value (this is the desired variable value)
* on column 2 (same line as column 1) I call this variable

so if I change the value in column 1 , it change on calumn 2

if there an embedded feature or maybe a thrid party soft you know that can do that?

thx a lot in advance


Answers:
author: Natalie Paramonova [Stiltsoft]
body: Hi Vincent,

You can resolve your task with the help of the [Table Transformer](https://docs.stiltsoft.com/display/TFAC/How+to+use+Table+Transformer+macro?utm_source=atl_community) macro (one of the [Table Filter and Charts](https://marketplace.atlassian.com/apps/27447/table-filter-and-charts-for-confluence?hosting=cloud&tab=overview&utm_source=atl_community) app).

The macro allows performing calculations with the help of SQL queries. Look at the example:

* The source table wrapped in the Table Transformer macro:

![2019-06-26_10h31_36.png](https://community.atlassian.com/t5/image/serverpage/image-id/58809i0CEE0ABEA4AAC5E6/image-dimensions/581x183?v=v2 "2019-06-26_10h31_36.png")

* The Table Transformer macro browser:

![2019-06-26_10h32_09.png](https://community.atlassian.com/t5/image/serverpage/image-id/58810i56B10BAF3B10962F/image-dimensions/576x334?v=v2 "2019-06-26_10h32_09.png")

* The resulting table:

![2019-06-26_10h32_31.png](https://community.atlassian.com/t5/image/serverpage/image-id/58808i8DCEC58C6BF0023E/image-dimensions/315x212?v=v2 "2019-06-26_10h32_31.png")

* The query:

SELECT \*,  
"<https://stiltsoft.com/>" + 'Category' AS 'URL'  
FROM T\*


author: EPS Software Engineering AG
body: Hi Vicent,

Maybe our Easy Confluence Variables could be a solution for you. You can define a variable on space level and use it in pages with %variable. Of course a search for the value or the variable name works. You can find the [Easy Confluence Variables](https://marketplace.atlassian.com/apps/1217150/easy-confluence-variables?hosting=server&tab=overview) on the Marketplace.

Regards,  
Stephan (CEO of EPS Software Engineering, the vendor of the Easy Confluence Variables)


author: Vincent
body: Thx a lot folks! I will try that and let you know!

have a nice day


author: Alex Medved _ConfiForms_
body: Have look at the app we offer, [ConfiTemplates](https://marketplace.atlassian.com/apps/1216556/confitemplates-templates-and-excerpts?hosting=server&tab=overview)

And this quick tutorial in particular - <https://wiki.vertuna.com/display/ST/Using+Confluence+page+properties+with+Smart+Templates>

You can define variables as page properties and you can use them inside the templates, template contents can be loaded from other pages if necessary, just like multi-excerpts


author: Vincent
body: Hi [Aleksandr](https://community.atlassian.com/t5/user/viewprofilepage/user-id/671242), the thing is that in the same page, I will have multiple Excerpt, I didn't find a way to use multiple Excerpt in the same page, because when I call the include Excerpt macro, it asks for the page of the Excerpt to include (but how can I tell him to use a specify Excerpt when there is plenty?)

thanks a lot in advance

comments: author: Aleksandr Zuevich
body: Hi Vincent,

Unfortunately I don't know how to achieve this using standard Confluence functionality. But I'd recommend this plugin: <https://marketplace.atlassian.com/apps/169/multiexcerpt>


author: Aleksandr Zuevich
body: Hi Vincent,

Do you mean to repeat the content of the cell inside other cell? If so you can use combination of standard Excerpt and Excerpt Include Confluence macros.

comments: author: Vincent
body: Hi Aleksandr, yes this is quite what I try to achive, more exactly, my goal would be to do something like:

column1, line 1 : JKR54HJ (it's a serial)

column2, line 1: http://mywebsite/check_warranty/JKR54HJ

(and if I change the serial in c1, the url change also in c2)

Can I use the native macro for that?

<br />

Thx a lot in adance


Tags: confluence-server

server

table