Can queryAndRender function be distinct filtered to show unique results only?

Mar Demolag November 28, 2024

For example, if I have forms:

  • F1
    • name1: Smart Dropdown from F2
    • info: Text
  • F2
    • name2: Text

and I want to make a TableView with the following:

  • F2.name2
  • table of unique F1 info values where name1==entry.id.

 

I tried the following, but it seems it doesn't seem to work:

id.queryAndRender(F1:@self;name1:[entry.id];info;table).uniqueBy(info)

Is it possible to distinct filter a queryAndRender tableview?

2 answers

1 accepted

1 vote
Answer accepted
Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 28, 2024

What should be unique? The value in the “info” field?

Mar Demolag November 28, 2024

yea

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 28, 2024

No, not with the queryAndRender

I think you will need to have something like a ListView with a nested and dynamically filtered TableView/CardView (where you can use distinct parameter)

Like Mar Demolag likes this
Mar Demolag November 28, 2024

Thanks

but how would you configure that?
If I make the ListView for F2 and the nested TableView for F1, it won't show F2 values which are not used in F1.

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 28, 2024

Why not? ListView shows fields from F2 and the nested TableView shows data from F1

Something like this https://wiki.vertuna.com/display/CONFIFORMS/Master+Detail+forms+or+how+to+show+data+from+2+forms+which+are+referenced+using+ConfiForms+smart+fields

Mar Demolag November 28, 2024

Oh, I haven't used fields outside of the nested TableView. I thought you meant something like that:

nested.jpg

Thanks, will try using this idea.

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 28, 2024

Yes, but you can also put a ConfiForms Field macro, setting it's field name to name2 under the ListView

Mar Demolag December 1, 2024

Thanks for the response!
Just before I close the question, is there a way to render the list view as a table? or is there another view that will give me the same effect but would render as a table?

I tried to put a confluence table inside the listview, but even without any spaces below it's visible that it's just a list of tables and not one table.

0 votes
Mar Demolag November 28, 2024

a possible solution I thought of would be using an expression instead of a field on the fields list:

queryAndRender(<formName:pageId>;<FILTER>;<FIELDS_OR_EXPRESSIONS>;<VIEW_TYPE>)

but for some reason it doesn't recognize expressions when I put them there.
Am I missing something regarding the usage of that function?

Whenever I try to put an expression there, no matter how simple the expression is, it just render the whole table, ignoring the fields.

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 28, 2024

What expressions "it doesn't recognize "?

Mar Demolag November 28, 2024

for example, I tried to put info.asCount() just to test it out also ([_count]), ([entry.)_count]) (_count).

queryCount doesn't fit there at all since there is a semicolon in it.

Mar Demolag December 2, 2024

I've seen now on another question that it is bugged on older versions of confiform.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events