Custom widget - mapping columns that are a reference

Hi there,

I am customizing the Invoice Widget ( grist-widget/invoices at master · gristlabs/grist-widget · GitHub ). It worked very well, until I tried to implement column mapping. All mapped column work well apart from REFERENCE columns (or MultiRef). When calling grist.onRecord(row, mapping), I can’t access the full data of the reference. For example I have a “customer” column (= “client” in the original widget) and a “detail” (=items) column, which are references and display the name of the customer and the product name. In the widget I can only get the names, not the rest of the attributes (customer.adress, customer.city, customer.email; detail.unit_price, detail.quantity, detail.total_price, etc.)

Calling

const mapped = grist.mapColumnNames(row, mapping); console.log(JSON.stringify(mapped));

returns me in the console:

{“id”:335,“customer”:“Vracrie”,“details”:["Bettrave rouge vrac ","Chou Chinois vrac ",“Flower sprout vrac “],“order_date”:“2025-12-08T00:00:00.000Z”,“order_id”:“C_2025-12-08_Vracrie”,“order_sales_sum_final”:37.72,“store”:””}

However, I’m expecting for customer and details objects with different attributes (name, adress, city, email; name of product, unit price, etc.)

I could access this data all well before mapping, now not anymore. Of course I can’t display them correctly in the widget either.

Anyone has an idea about that, or had this issue before? I guess I could make a workaround with fetchTable and access the data from somewhere else, or duplicates all the columns I need in my invoice table, but it seems quite complicated.

Thanks a lot