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.
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?
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.
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
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.
Feeling overwhelmed by the demands of work and life? With a 25% increase in the prevalence of anxiety and depression worldwide during the pandemic, for most of us, it’s a resounding yes . 🙋♀️ ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events