Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lookup one changes in rl #339

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions help/en/docs/references-lookups.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,19 @@ Such a formula returns a reference. In the screenshot above, you can see the loo
It's often a good idea to create a column for the lookup result and change its type to Reference, as you see in the screenshot below. Then, if there is a match, the reference column will point to the entire matched record. Like any reference column, you can select which field from that record to show. In this example, it shows the Company field of the matched record in the Sponsors table.

<span class="screenshot-large">*![sponsors-lookupone](images/references-lookups/sponsors-lookupone.png)*</span>
Alternatively, we could use the following formula to illustrate an example to find the earliest interaction associated with a specific contact ID:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be clearer to say "associated with a specific contact"? or "associated with the contact in the current record"?

I am also scratching my head a bit about the word "Alternatively". Reading where this goes in the article, I don't see what you meant to connect it too -- maybe you intended to place this somewhere else?


```
Interactions.lookupOne(Contact=$id, sort_by="Date")
```

Specifically, sort_by causes multiple results to be sorted by Date, in ascending order, and since lookupOne returns the first of the matches, it becomes the earliest date.
mnickolas113 marked this conversation as resolved.
Show resolved Hide resolved

Additionally, we can use the (-) symbol and reverse the order, finding the latest interaction:

```
Interactions.lookupOne(Contact=$id, sort_by="-Date")
```

## lookupOne and dot notation

Expand Down