You want your Asana tasks in a Google Sheets™ tab, and you'd rather call the API yourself than export a CSV every Monday. That's a fair call. The Asana API is clean, and Apps Script runs inside the sheet, so there's nothing to host.
Below is a script for a real project: it reads every task, follows the pages, and waits when Asana says to wait. I also mark where a script like this stops being worth your time. The API details come from Asana's pagination and rate limits pages, read on 30 November 2026.
The short answer
To connect to the Asana API from Google Sheets, create a personal access token in the Asana developer console, store it in Apps Script's script properties, and call https://app.asana.com/api/1.0/projects/<project ID>/tasks with UrlFetchApp. Send the token as Authorization: Bearer <token>, ask for 100 tasks a page, and follow next_page until it's empty. Write the rows with setValues in one call.
Before the first line of code
- A personal access token. Open the Asana developer console, create a token and copy it once. Treat it like a password: it acts as you, with your access.
- The project's ID. Open the project in Asana. The long number after
/project/in the address bar is the ID. - A sheet to write into. In it, open Extensions, then Apps Script.
In Apps Script, open Project Settings and add 2 script properties: ASANA_TOKEN and PROJECT_GID. Don't paste the token into the code. Anyone you share the script with sees its code and can't see the properties.
The script
Paste this into the Apps Script editor and run importAsanaProject. Google asks you to approve access to the spreadsheet and to external requests the first time.
const BASE = "https://app.asana.com/api/1.0";
const FIELDS = "name,completed,due_on,assignee.name,memberships.section.name";
function importAsanaProject() {
const props = PropertiesService.getScriptProperties();
const token = props.getProperty("ASANA_TOKEN");
const projectGid = props.getProperty("PROJECT_GID");
const rows = [["Task", "Done", "Due", "Assignee", "Section"]];
let url = `${BASE}/projects/${projectGid}/tasks?limit=100&opt_fields=${encodeURIComponent(FIELDS)}`;
while (url) {
const body = fetchWithRetry(url, token);
body.data.forEach((t) => {
rows.push([
t.name,
t.completed,
t.due_on || "",
t.assignee ? t.assignee.name : "",
t.memberships && t.memberships[0] && t.memberships[0].section
? t.memberships[0].section.name
: "",
]);
});
url = body.next_page ? body.next_page.uri : null;
}
const sheet = SpreadsheetApp.getActiveSheet();
sheet.clearContents();
sheet.getRange(1, 1, rows.length, rows[0].length).setValues(rows);
}
function fetchWithRetry(url, token) {
for (let attempt = 0; attempt < 5; attempt++) {
const res = UrlFetchApp.fetch(url, {
headers: { Authorization: `Bearer ${token}` },
muteHttpExceptions: true,
});
const code = res.getResponseCode();
if (code === 200) return JSON.parse(res.getContentText());
if (code === 429) {
const headers = res.getHeaders();
const wait = Number(headers["Retry-After"] || headers["retry-after"] || 30);
Utilities.sleep(wait * 1000);
continue;
}
throw new Error(`Asana returned ${code}: ${res.getContentText()}`);
}
throw new Error("Still rate limited after 5 tries");
}
I ran the paging and retry logic against a stub of UrlFetchApp: a 429 with Retry-After: 7 made it sleep 7 seconds, then it followed next_page to a second page and wrote both tasks. That checks the loop. It doesn't replace one run against your own project.

Paging, fields and the retry
limit=100 is on every call. Asana returns at most 100 objects a page. Without limit, some older endpoints return everything in one go. They can time out or truncate a big project. With it, you get a next_page object holding the uri of the next call, or null when you're done. Follow the uri as it comes. Offsets expire, so don't store one for tomorrow.
opt_fields picks the columns. Asana's default reply is thin: an ID, a type and a name. You have to request anything else, such as the due date or the assignee's name. Dotted names reach into nested objects, so assignee.name works. Request only what the sheet shows, since bigger replies cost more of the budget.
The retry reads Retry-After. When you go over a limit, Asana answers 429 Too Many Requests with a Retry-After header in seconds. Rejected requests still count against your quota, so waiting less than that makes the next window worse. The script sleeps exactly that long. Our post on Asana API limits covers the 5 limits behind that reply, and which one you've probably hit.
A single setValues for the whole table is far faster than setting cells one at a time. Speed matters here because a single Apps Script run stops after 6 minutes.