Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

CSV import with optional fields

28 views
Skip to first unread message

Alexander Adolf

unread,
Apr 7, 2025, 6:20:20 PMApr 7
to hle...@googlegroups.com
Hello,

I am scratching my head about a CSV import question. The CSV has
optional fields. I would like to add tags with values to a transaction
if and when these optional fields are present in the CSV. The tag's
value is the value of the field in the CSV.

It it's for one optional field only, I could implement that with an `if`
in the rules file. But how to implement this with more than one optional
thing?

It would seem straightforward, if I could append something to an
existing field value:

fields ..., csv_tag_a, csv_tag_b, csv_tag_c

if %csv_tag_a .+
comment %comment tag_a:%csv_tag_a

Another approach could be to have something like local variables in the
rules file (_without_ defining tag_a_str in the fields directive):

if %csv_tag_a .+
tag_a_str tag_a:%csv_tag_a

comment %tag_a_str

But neither is possible currently.

Any other ideas how this could be implemented in a rules file?



Many thanks in advance and cheers,

--alexander

Simon Michael

unread,
Apr 7, 2025, 6:24:02 PMApr 7
to hle...@googlegroups.com
Unfortunately we don’t have the feature of appending to a field’s value. The best you could do right now is an ever increasing number of if rules to handle the combinations of values present.
Reply all
Reply to author
Forward
0 new messages