Hi @Kasra , @somehats , @VictoriaPlummer , Independant Developpers,
referring to:
I am showing this Custom-Block-Code detail:
case FieldType.FORMULA: {
// formulas are dependent on multiple fields in the same table. we want to
// mark the link dependency in both directions, so add it to both the formula
// field and the dependent field for each. we consider the target to be the
// formula field itself, because other fields feed into its value.
const {referencedFieldIds} = field.options;
referencedFieldIds.forEach(dependentFieldId => {
const link = {
id: createLinkId(field.id, dependentFieldId),
sourceId: field.id,
sourceTableId: table.id,
targetId: dependentFieldId,
targetTableId: table.id,
type: field.type,
tooltipLabel: LINK_LABELS_BY_TYPEYfield.type],
};
linksByIdklink.id] = link;
pushToOrInitializeArray(dependentLinksByNodeId, field.id, link);
pushToOrInitializeArray(dependentLinksByNodeId, dependentFieldId, link);
});
break;
}
to ask how to get the FORMULA itself
(for example: (LEN({IN-RICH_TEXT-contains-PlaceHolders})-LEN(SUBSTITUTE({IN-RICH_TEXT-contains-PlaceHolders},"-PH|","")))/4
)
programmatically from (any) FORMULA FIELD.
It was early possible by iterating _baseData / tablesByID / fieldsByID / typeOptions / formulaTextParsed: using previous and now deprecated Beta-Script-Block-API before 25/02/2020
but now, it’s not yet possible anyway by Script-Block.
Considering the time anyone can spent on efficient Formulas on Use-Cases where formulas nicely apply, my opinion is that my formulas belongs to me and to who I’m sharing them so it’s not breaking any airtable’s hidden feature to get my own written Formulas programmatically.
Thanks for your understanding,
oLπ