_anomDiebolt_
7 years agoQrew Elite
Catamorphism Fields
I wanted to show you a new demo I put together that "summarizes" text fields in child records to the parent record that uses the new 3Q&S technique. After I show you the demo I will generalize what the technique can do and relate it to the title of this thread.
I haven't seen the new "combine text option for summary fields" yet but what I will show you blows the doors off this point feature in terms of what it can accomplish by "summarizing" or "aggregating" data in child fields to the parent record.
Using the same data in the demo mentioned in this post:
Formulas and Reports
https://community.quickbase.com/quickbase/topics/formulas-and-reports
Programs ~ List All
https://haversineconsulting.quickbase.com/db/bn8if57nu?a=td
I convert the multi-select field to child records as demonstrated here:
Programs ~ View Record 1
https://haversineconsulting.quickbase.com/db/bn8kwquqq?a=dr&rid=1
The field [Equity Focus Areas] in the parent table is a Rich Text Formula field written in the style of the 3Q&S technique and has this definition:
This formula is self-contained and requires no setup such as is needed with other script injection techniques. You can modify the parameters and immediately use it in your application.
Additionally, you can modify the formula so that it styles the aggregated text into pills or bubbles
or performs additional transformations (such as hyperlinking) on the child fields prior to being inserted into the parent cell. There really is no limit to how you can process the child records into the parent record "summary" or "aggregate" field.
And the generality does not stop there. All of the aggregation functions hinted at in this screenshot can be accomplished with simple extensions to the above script:
Now lets relate this "aggregation" or "summary" feature to the title of this post "Catamorphism Fields".
Catamorphism is just a super abstract concept in Mathematics that means to take a list of items and produce a single result. Programmers might call this process "fold" or "reduce" and layman might call this "summarize" or "aggregate".
It is great that QuickBase has introduced text summary fields but occasionally you are going to need other aggregation features that can easily be created using the 3Q&S technique.
Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=705
I haven't seen the new "combine text option for summary fields" yet but what I will show you blows the doors off this point feature in terms of what it can accomplish by "summarizing" or "aggregating" data in child fields to the parent record.
Using the same data in the demo mentioned in this post:
Formulas and Reports
https://community.quickbase.com/quickbase/topics/formulas-and-reports
Programs ~ List All
https://haversineconsulting.quickbase.com/db/bn8if57nu?a=td
I convert the multi-select field to child records as demonstrated here:
Programs ~ View Record 1
https://haversineconsulting.quickbase.com/db/bn8kwquqq?a=dr&rid=1
The field [Equity Focus Areas] in the parent table is a Rich Text Formula field written in the style of the 3Q&S technique and has this definition:
"<img " &
"data-rid='" & [Record ID#] & "' " &
"src onerror='
(async () => {
var dbid = 'bn8kwp9zq';
var dbidPrograms = 'bn8kwquqq';
var dbidEquityFocusAreas = 'bn8kwtf5y';
var apptoken = 'c8ewpu4n734z94w2zqwdiu8s8n';
$.ajaxSetup({data: {apptoken}});
var fidRelatedPrograms = '7';
var fidEquityFocusArea = '6';
var tagEquityFocusArea = 'equity_focus_area';
var rid = this.dataset.rid;
let xml = await jqajax(
$.get(dbidEquityFocusAreas, {
act: 'API_DoQuery',
query: '{${fidRelatedPrograms}.EX.${rid}}',
clist: fidEquityFocusArea
})
);
var markup = $('record', xml).map(function (index, record) {
return $(tagEquityFocusArea, record).text();
}).get()
.join(', ');
this.outerHTML = markup;
// helper function
async function jqajax(jqpromise) {
return Promise.resolve(jqpromise);
}
})();
'>"
This formula is self-contained and requires no setup such as is needed with other script injection techniques. You can modify the parameters and immediately use it in your application.
Additionally, you can modify the formula so that it styles the aggregated text into pills or bubbles
or performs additional transformations (such as hyperlinking) on the child fields prior to being inserted into the parent cell. There really is no limit to how you can process the child records into the parent record "summary" or "aggregate" field.
And the generality does not stop there. All of the aggregation functions hinted at in this screenshot can be accomplished with simple extensions to the above script:
Now lets relate this "aggregation" or "summary" feature to the title of this post "Catamorphism Fields".
Catamorphism is just a super abstract concept in Mathematics that means to take a list of items and produce a single result. Programmers might call this process "fold" or "reduce" and layman might call this "summarize" or "aggregate".
It is great that QuickBase has introduced text summary fields but occasionally you are going to need other aggregation features that can easily be created using the 3Q&S technique.
Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=705