I am building a table-data macro in Scaffolding where the user enters data in the the first few columns, but the last few are calculated off of the values the user has entered in the first few. I need a way to reference these values by current row and I'm not able to find answers anywhere. I have the following variable injected into a sql query, but i need to replace the 0 with the current row as the table is built:
'%data:MyTable.0.MyValue%'
In other words, something like:
'%data:MyTable.ROW_NUMBER().MyValue%'
Any direction would be greatly appreciated, thanks!!
Hi Amber,
It's unclear how the macros are really configured on the page. Perhaps you can share some screen shots/storage format of the page so we can get a better overview of this.
Thanks!
Sure thing. So I'm trying to create a table that calculates the actual vs estimated costs of a project by team. So each team would come in and enter their Cost Center and hourly estimates for the project in the first three columns. On that same line in the last two columns, I would like a query that goes out and pulls their actual hours and cost towards that project. In order to do that, I need the query on each row to be able to reference the Cost Center that was entered in the first column. Adding screenshots as well.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried goofing around with the eval-data macro as well, but it didn't work when wrapped in a sql query macro. I'm so close. What am i missing?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amber, can you let me whether are you using the Pro Edition or Express Edition for Bob Swift's SQL for Confluence? Additionally, is it possible for you to provide me a storage format of the said page for further investigation?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here's an even simpler example. I just want table data and I would like one of the columns to be a calculation off of a date entered. A user comes in and enters the create date and I would like the table to automatically calculate the duration from that date to today's date in days. Is this possible?
The code below:
<p><br /></p><ac:structured-macro ac:name="table-data" ac:schema-version="1" ac:macro-id="9e96b060-4d2b-4b9e-9414-cecd3380fb83"><ac:parameter ac:name="name">Change Orders</ac:parameter><ac:rich-text-body> <p class="auto-cursor-target"><br /></p> <table class="wrapped"><colgroup><col /><col /><col /></colgroup> <tbody> <tr> <th>Change Order #</th> <th colspan="1">Create Date</th> <th colspan="1">Testing</th></tr> <tr> <td> <div class="content-wrapper"> <p class="auto-cursor-target"><br /></p><ac:structured-macro ac:name="number-data" ac:schema-version="1" ac:macro-id="148560fc-0e71-4ea3-bdc5-9f22708a65ad"><ac:parameter ac:name="name">Order Number</ac:parameter><ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter></ac:structured-macro> <p class="auto-cursor-target"><br /></p></div></td> <td colspan="1"> <div class="content-wrapper"> <p class="auto-cursor-target"><br /></p><ac:structured-macro ac:name="date-data" ac:schema-version="1" ac:macro-id="f643e31d-f154-4b90-bbad-a3013c542138"><ac:parameter ac:name="format">M/d/y</ac:parameter><ac:parameter ac:name="name">Create Date</ac:parameter><ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter></ac:structured-macro> <p class="auto-cursor-target"><br /></p></div></td> <td colspan="1"> <div class="content-wrapper"> <p class="auto-cursor-target"><br /></p><ac:structured-macro ac:name="report-on" ac:schema-version="1" ac:macro-id="7d840c54-86a4-4a07-a58a-9926771e49f0"><ac:parameter ac:name="injected">true</ac:parameter><ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter><ac:rich-text-body> <p class="auto-cursor-target"><br /></p><ac:structured-macro ac:name="eval-data" ac:schema-version="1" ac:macro-id="5cdacf52-f8ec-462c-8765-66068b8c2e29"><ac:parameter ac:name="format">#</ac:parameter><ac:parameter ac:name="name">Date Calc</ac:parameter><ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter><ac:plain-text-body><![CDATA[(%global:current date>date:milliseconds% - %data:Change Orders.${rowCount}.Create Date>date:milliseconds%)/1000/60/60/24]]></ac:plain-text-body></ac:structured-macro> <p class="auto-cursor-target"><br /></p></ac:rich-text-body></ac:structured-macro> <p class="auto-cursor-target"><br /></p> <p class="auto-cursor-target"><br /></p></div></td></tr></tbody></table> <p class="auto-cursor-target"><br /></p></ac:rich-text-body></ac:structured-macro> <p class="auto-cursor-target"><br /></p>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi AmberH,
Thank you for getting back to us.
Regarding your latest question, I would like to regretfully say that the current system does not provide such calculation/ processes for date data macro.
Should you have any more enquiries, I'll be more than happy to assist you at any given time.
Thank you
Mozhda Barekzai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.