How to pass a lookup value via API (or copy paste or anything)?

Problem

I’m trying to add expenses to the EXPENSES table via API, specifically using the Zapier integration.

The issue is with adding already known values from a list.

Here’s the doc shared

I have a table People (with people in it), and a table Expenses, which has a column with a drop down of all possible people from the table People (naturally). It has a column lookup…

I can’t make this work with the Zapier/API.

What do I send to this cell of a new row to populate the field with the right Person from the table People?

Everything gets parsed as a text… nothing I try ends up correctly matching the lookup value and using that.

I tried all I could think off from the api get of the desired target of the lookup.
I tried to get some id from the API, but not sure how to use it.

index:	0
name:	Filip
values:
c-UqX7n3kPLq:	$20.00
c-8023jxb0p1:	grocery
c-NLT-8Pw5jE:	Filip
displayValue:	Filip
type:	row
id:	i-g4dDzUa3Pm
createdAt:	2018-02-06T22:23:41.955Z

Example:

People has rows Filip and Marie. Filip adds an expense of $22, specifying he is the one who paid (this columns is a lookup to the table People).

I tried to pull the Filip row data from People, but nothing here parses either (I tried the id and the display id and the row value and name… )

PS

This works fine with a simple Select List column like Category in my table. It just does not work when the column is a lookup of another table :frowning:

Thanks for suggestions!

Hi @cblock, happy to help! Our API does have support for lookup and people columns; here’s how it works (elaborating here for future reference):

  • For Lookup from table columns, specify the text-only name of your lookup value’s display column, and when inserted it will get matched to the row
  • For People columns, you can use either the full name of the person or their email address. Note that the person already needs to be in the doc (i.e., show up directly in the People dropdown, not under “Show more” if you have a G Suite account)

Also for both types of columns in multi-select mode, you can pass in an array or comma-separated list to insert multiple values.

I’m not entirely sure why “Filip” in your example wouldn’t get matched the same way as via the select menu. If you could reach out to us via in-doc help and share the doc with support@, we can take a look to see if there’s maybe a bug on our end or an issue in your doc.

2 Likes

Hi @oleg, I am facing the same problem as @cblock. I try to upsert a row into a table via the API that contains a lookup column. The mutation works without any error but the lookup column value looks like a text entry not like a reference. Looking at your response do you mean by text-only name that the value although it is a string column cannot contain numbers in the string. My lookup values look like m1-2022-23 or m2-2022-23. Thanks in advance for clarifying.

I’m having the same problem. For me, I just inserted a row that has an RowID of 624 in table 1 via the API. The Row ID is the display name. I then go and insert a row into table 2 that has a lookup to table 1 via the API. I put down 624 as the value, but when I go to check the value in the row in table 2, 70% of the time it is shown as text and not as a row reference. What am I missing?

Was this ever resolved? I’m experiencing the same thing, passing in a string that is a value from the display column for the lookup. I can watch my table, and see the value that was sent via API appear in the field briefly as a string, and then disappear.

Hi @glen_dresser - I tried to reproduce that problem, but sending the display name of the row works correctly in my doc. Is it possible to share a doc and request that reproduces the error?

We also recently added support for sending the row ID of the target row, as a more accurate way to set the value.