AqBanking: Generating memo field from user-supplied template
John Ralls
jralls at ceridwen.us
Fri Jan 9 22:48:05 EST 2026
> On Jan 9, 2026, at 09:26, Martin Preuss <martin at aquamaniac.de> wrote:
>
> Dear Gnucash Developer Team,
>
> I'm sometimes confronted with questions about how the memo fields of imported transactions in apps are generated and how this could be modified by the user.
>
> IMHO the current way this work is divided between apps and AqBanking is the best possible. AqBanking provides the relevant information in AB_TRANSACTION and the app must decide for itself if and how it wants to use or combine that information to generate memo strings.
>
> To help with this I just added a basic function to AqBanking which creates memo strings for transactions using template strings. Such a string could be stored e.g. with account settings.
>
> A template string in context of this function can contain fixed text and/or names of variables of a AB_TRANSACTION object (e.g. "$(purpose)" or "$(remoteName)").
>
> A template string of "$(purpose)" would just return the value returned by AB_Transaction_GetPurpose().
> More complex strings like "$(purpose) $(transactionText) $(ultimateCreditor)" could combine multiple fields.
>
> The function is "AB_Banking_ConstructMemoFromTemplate()" in AqBanking's src/libs/aqbanking/banking_transaction.c" (less than 30 lines of raw code, so easily usable as code basis for your own implementation).
>
Martin,
Thanks. That’s a good idea and it’s nice that you’ve provided sample code.
Regards,
John Ralls
More information about the gnucash-devel
mailing list