How to combine two ConfiForms tables of same structure in one view

Ulrik Schoth
Contributor
April 17, 2023

I would like to display the contents of two ConfiForms tables with the same structure in a combined view. 

Example

  • Both tables have just one field named "Type".
  • Table 1 has 3 records of "A", "B", "C".
  • Table 2 has 2 records of "D", "E".
  • The target table shall display all 5 records in one table and with one column heading named "Type".

Although this seems to be a very simple question, I have not been able to achieve this. I'd greatly appreciate if anybody can show me a solution. Thanks.

2 answers

2 accepted

0 votes
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.
April 18, 2023

Hi

It is indeed a quite simple task in our opinion... And the TableViewMerger is the macro to use

However, you need to be careful with ConfiForms Field macros that you have as these are used as "grouping keys"

So, you want to merge the data from different forms and in this case it would be greate to add a field that has a unique value, and that is an "id" field

Add a ConfiForms Field with field name set to id

And mark it to be used as "key"

hide-as-key.png

Alex

Ulrik Schoth
Contributor
April 18, 2023

Hi @Alex Medved _ConfiForms_

Thanks a lot for this tip! I will use it in my merged tables in the future.

In the meantime, we found the cause of my problem (see my related comment). And now that I know how to use the Table Merger macro properly, I would say: you are right, it is indeed quite a simple and intuitive task! 😅

0 votes
Answer accepted
Ulrik Schoth
Contributor
April 17, 2023

Here's what I did: I wrapped two TableView macros with the TableView Merger macro. This would be intuitive in my opinion. Unfortunately, the result was not as expected.

I have tried some of the settings in the TableView Merger macro, but without success.

result.png

 

And just to clarify what I expected (unfortunately only obtained by editing the above image):

expected-result.png

Ulrik Schoth
Contributor
April 18, 2023

A colleague showed me what was wrong in my code: I just had to empty the body of the TableView macros and put the Field and Edit Controls macros directly into the body of the Table Merger macro.

So, instead of using this code:

wrong-code.png

I just have to use the code below and everything works as expected:

correct-code.png

Since I have always used the TableView macro in the past with field and edit control macros in its body, I would never have thought of this! I was not even aware that you could use the TableView macro with an empty body. 🤦‍♂️

Like # people like this
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.
April 19, 2023

Yes, but this way it will aggregate by "type" field - meaning that a record with the same value in the "type" field will be "skipped", counted, but skipped

You will see only the unique results by "type"

Ulrik Schoth
Contributor
April 19, 2023

Hi @Alex Medved _ConfiForms_

do you mean that if the table values are as follows

tables-1-and-2.png

this solution

correct-code.png

should result in a table like so

table-A-B-C-E.png

because the second record with "B" will be skipped?

Ulrik Schoth
Contributor
April 19, 2023

At least in my test environment this is not the case. The displayed table looks like this:

result-1.png

Only when I add a field macro with fieldName=Count:([count]), the second record with "B" is not displayed anymore, because both "B" records are aggregated (I just wonder where the Edit Controls have gone in this table).

result-2.png

And if I add an additional field "id" as you suggested in your answer above, the result looks like this:

result-3.png

In all three cases, the result seems comprehensible to me and we can gladly close this topic. 😃✅

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.
April 23, 2023

Edit is not possible when you aggregate data - as... what will record you will edit in that case? 

That is why the edit controls are gone on aggregated views

Alex

Like Ulrik Schoth likes this
Ulrik Schoth
Contributor
April 24, 2023

You are, of course, absolutely right! I had not thought of that. Thanks for your explanation!

Ulrik

Markisio
Contributor
October 17, 2023

hi @Alex Medved _ConfiForms_  and @Ulrik Schoth 

 

curious if we can somehow identify where the data is from, ie form1 and form2, is there a solution for that?

 

Type, Form

A, Form1

B, Form2

....

 

thanks 

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.
October 17, 2023

In TableViewMerger ConfiForms creates virtual fields like this

  • _sourcePage - of type page
  • _sourceForm - of type text

Alex

Like Markisio likes this
Markisio
Contributor
October 17, 2023
Dhiraj Kr_ Gupta
Contributor
May 22, 2024

Any chance of side merger like if table 1 is A, B, C and table D, E, F

A      D

B.      E

C.      F

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.
May 22, 2024

How should ConfiForms know that A belongs to D, and etc? Do they share a "common key"?

Dhiraj Kr_ Gupta
Contributor
May 22, 2024

Yes

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events