Child table value concatenate with comma

In expense claim I need to bring the expense claim types (child table field) into list view and need to add in the standard filter.
If it is not possible , I can create a custom data field where and can concatenate the values of child table expense claim types separated by commas while saving the document.
Eg: food, fuel, rent etc.
And then this filed can be added over there.

Is it possible to do with custom script ?

Hi @Rahul-R,

We did apply a similar scenario, please check the syntax.

frappe.ui.form.on("Expense Claim", {
    before_save: function(frm) {
        const get_expense_types = () => {
            let expense_claim_types = [];
            frm.doc.expenses.forEach(function(row) {
                expense_claim_types.push(row.expense_type);
            });
            return expense_claim_types.join(', ');
        };
        frm.set_value("remark", get_expense_types());
    }
});

Output:

Please set your field according.

Thank You!

1 Like