Most Lark Base formulas work on a single value at a time. That becomes a problem the moment you are dealing with linked records, because a link field returns a list of values rather than one. MAP() solves this by applying the same calculation to every item in a list and returning a new list of results, which you can then total, format or feed into another formula.
What the MAP Function Does
MAP() takes a list of values and a rule, applies that rule to each value in turn, and hands back a list of the same length. The syntax is:
MAP(list, expression)
Inside the expression, CurrentValue stands for whichever item MAP() is working on at that moment. So MAP(Unit Prices, CurrentValue * 0.85) multiplies every price in the list by 0.85 and returns all the discounted prices.
This is what makes bulk calculations possible. SUM() can add a list up and TEXT() can format a number, but neither can transform each item first. MAP() fills that gap.
The Scenario: Discounting a Multi-Item Order
A client, Bob, has ordered several products drawn from two separate inventory tables. We want to apply his loyalty discount to every item, then return one grand total formatted as ringgit.
The record uses these fields:
- Client: The customer name, Bob.
- Product Link and Product 1 Link: Link fields pointing at the two inventory tables.
- Unit Prices (Product) and Unit Prices (Product 1): Lookup fields that pull the price of each linked item.
- Discounted Rate: The client’s discount, entered as a decimal. Here it is 0.15, or 15 per cent.
- Product after discount and Product 1 after discount: Formula fields that use MAP() to discount each price individually.
- After discount: The single grand total, formatted as currency.
Setting Up the Tables
The two inventory tables
The first table, Product, holds everyday grocery items and their unit prices.
The second table, Product 1, holds a separate range of items with their own prices.
Linking the client’s chosen products
In the client record, the Product Link field selects Apple, Banana and Chocolate.
The Product 1 Link field selects Wolf Berry, Red Dates and Gin Seng.
The two lookup fields then return the matching prices as lists: 11.00, 3.70, 2.50 from the first table and 15.00, 80.00, 13.00 from the second.
Note: A lookup field returns a list, not a single number. This is exactly why an ordinary multiplication will not work here, and why MAP() is needed.
Writing the MAP Formula
The Product after discount field applies the discount to every price in the first list:
MAP(Unit Prices (Product), CurrentValue * (1 – Discounted Rate))
With a rate of 0.15, each price is multiplied by 0.85. The list 11.00, 3.70, 2.50 becomes 9.35, 3.145, 2.125.
The Product 1 after discount field does the same for the second list:
MAP(Unit Prices (Product 1), CurrentValue * (1 – Discounted Rate))
Here 15.00, 80.00, 13.00 becomes 12.75, 68.00, 11.05.
Tip: Keeping these as separate formula fields is useful while you are building the base, because you can see the discounted figures item by item and confirm the maths before combining everything.
Combining MAP with SUM and TEXT
Once each list is discounted, the After discount field nests three functions to produce one clean figure: MAP() transforms each price, SUM() adds the results, and TEXT() formats the outcome as currency.
“RM” & TEXT(SUM(SUM(MAP(Unit Prices (Product), CurrentValue * (1 – Discounted Rate))), SUM(MAP(Unit Prices (Product 1), CurrentValue * (1 – Discounted Rate)))), “0.00”)
Reading it from the inside out:
- Each MAP() discounts every price in its own list.
- Each inner SUM() adds that discounted list into a single number: 14.62 and 91.80.
- The outer SUM() combines the two into 106.42.
- TEXT() formats it to two decimal places, and the “RM” prefix is joined on with the ampersand operator.
The result is RM106.42, calculated live and updating automatically whenever Bob’s product selection or discount rate changes.
Practical Use Cases for SMEs and Startups
- Tiered client pricing: Apply each customer’s own discount rate across a whole basket without maintaining separate price lists.
- Quotation builders: Let sales staff tick line items and have the discounted quote total calculate itself.
- Commission calculations: Apply a percentage to every deal linked to a salesperson, then total the payout.
- Tax and service charges: Add a fixed percentage to each line of an order before summing.
- Inventory valuation: Multiply quantity by unit cost across every linked stock item to get a total holding value.
Frequently Asked Questions (FAQ)
What does the MAP function do in Lark Base?
MAP() applies the same calculation to every value in a list and returns a new list of results. It is designed for lists of data that come from linked or lookup fields, where a single-value formula would fail.
What is CurrentValue in a Lark Base formula?
CurrentValue is a placeholder for the item MAP() is processing at that moment. As MAP() moves through the list, CurrentValue takes on each value in turn, so one expression covers every item.
Why can’t I just multiply a lookup field by a number?
A lookup field on a link with several records returns a list rather than a single number, so a plain multiplication has nothing to work on. MAP() steps through the list and applies your calculation to each entry.
Can I use MAP together with SUM in Lark Base?
Yes, and it is the most common pairing. MAP() transforms each item, then SUM() collapses the resulting list into one number. You can nest further SUM() functions to combine totals from several lists.
How do I show a Lark Base formula result as currency?
Wrap the number in TEXT() with a format such as “0.00” for two decimal places, then join a currency prefix using the ampersand operator, for example “RM” followed by the TEXT() result.
Does the MAP result update automatically?
Yes. Formula fields recalculate whenever their inputs change, so adding a product to the link field or editing the discount rate updates the total straight away.
Can MAP handle more than two linked tables?
Yes. Add a MAP() and SUM() pair for each additional lookup field and include them in the outer SUM(). The pattern stays the same however many lists you are combining.
Getting More Out of Your Lark Base Formulas
MAP() is the function that turns Lark Base from a place where you store linked data into a place where you can calculate across it. Once you are comfortable with the MAP, SUM and TEXT pattern, most pricing, commission and valuation problems become a single formula field rather than a manual spreadsheet exercise.
Ready to Power Your Business with Lark?
Lark Base is just one part of an all-in-one platform that brings messaging, meetings, documents, approvals, and automations together for your entire team.
As the Platinum Partner for Lark in Malaysia, Exabytes offers tailored Lark plans, hands-on onboarding, and dedicated local support to help your team automate calculations that are still being done by hand.



























