Hi,
Basically I am trying to do as per this tutorial: https://docs.servicerocket.com/scaffolding/user-guide/intermediate-tutorials/retrieving-data-from-inside-a-table-or-repeating-section
But instead of getting item 0 (from the bottom of the list), I want to get the top or the latest item in the list. I do NOT know how many items will be in the list so can not use a fixed value. Is there a variable that accomplishes this in Confluence?
It seems a simple question but I can't find the answer documented anywhere.
Thanks!
Try below to get the last/latest row in the table
data:<table name> > collection:last > data:<column name>
Hi guys,
Does anyone else have any ideas on this?
This problem blocks a large chunk of work we were planning. It is such a frustrating simple requirement I can't believe a solution doesn't exist!
Thanks in advance for any help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ian,
I'm not familiar with this plugin, but had a thought. Putting it here in case it helps: Typically when there's array of objects starting with 0 in a programming language, you can usually access the last item with "-1". This may be following the same logic.
Does -1 work to pick the last object?
– Zak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Zak,
Thanks a lot for the suggestion! That was one thing I hadn't tried yet.
Sadly it didn't work though...
I also tried size, length, max, top, but none work.
The other thing I tried is changing the "Order" property of the "Repeating Data" macro. Sadly this just changes the order the items are drawn, not the order they are stored so 0 is still the oldest data.
Summary: There must be a variable counting the number of Data blocks added here but really can't find it in any documentation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ian,
I am not on the Confluence team but I will try to help.
It sounds like what you are trying to do is create a Dynamic Table? https://docs.servicerocket.com/scaffolding/user-guide/basic-tutorials/creating-a-dynamic-table
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply.
Yes: either a dynamic table or repeating data block, I guess it works the same.
The key part is I then need to use GetData macro to get data from the fields. As per the original tutorial I linked, it is easy to get the "last item" (item 0) from the table. But I want to get the "first item" or the most recently added. I don't know how many rows are in the table (or blocks in the repeating macro) so it must be a variable rather than a fixed value.
So summary: I want to do the above but "name = repeat.size.repeatText".
Any further help is appreciated.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.