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

new-rl-enroll-changes #342

Merged
merged 3 commits into from May 13, 2024
Merged

Conversation

MichaelNickolas
Copy link
Collaborator

had to re-do a PR in the right account

Copy link

netlify bot commented May 8, 2024

Deploy Preview for grist-help-preview ready!

Name Link
🔨 Latest commit b5c6538
🔍 Latest deploy log https://app.netlify.com/sites/grist-help-preview/deploys/663cec9214ed9d0008695698
😎 Deploy Preview https://deploy-preview-342--grist-help-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.


Then, the following formula would look at the Students table, find the specific students associated with each family, sort them by their birthday, and return their full name:

`Students.lookupOne(Family=$id, sort_by="Birthday").Full_Name`
Copy link
Member

Choose a reason for hiding this comment

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

Let's change to return student references, and make it a reference column, both here and below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Now I totally get what you were saying. I was vastly overcomplicating it in my head!


Additionally, we have a Families page that outlines the parent of each student and we’d like to find which student in each family is the oldest. So, we would create an oldest student column.

<span class="screenshot-large">*![family-table](images/references-lookups/oldest-student.png)*</span>
Copy link
Member

Choose a reason for hiding this comment

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

This screenshot is much larger, making text inside much smaller, than most screenshots in our docs. This is particularly problematic for small screens. You can resize your window before taking screenshots, or zoom in maybe(?), but it should be at a similar scale to others.

Copy link
Member

Choose a reason for hiding this comment

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

This, and another file, are not used. Please review for such things and delete unneeded things (or avoid committing them in the first place).

@@ -115,6 +115,32 @@ The entire formula would be `Sponsors.lookupOne(Contact_Email=$Registration_Emai

Now, we have the Sponsor Level listed in the All Registrations table for those attendees whose emails also appear on the sponsor list.

## lookupOne and sort_by ##

The `lookupOne` function and the optional `sort_by` parameter can be used together to sort multiple matching results to determine which of them is returned. You can also prefix the column ID with "-" to reverse the order.
Copy link
Member

Choose a reason for hiding this comment

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

"to determine which of them is returned" -- I think it would be good to say how it's determined, since it's so easy (first of matches, after sorting?). Something like this perhaps? ... When the lookupOne function encounters multiple matching results, it returns the first one by row ID. The optional sort_by parameter can be used to sort these results by another field, to determine which one would be returned as the first match.


<span class="screenshot-large">*![family-table](images/references-lookups/oldest-student.png)*</span>

Then, the following formula would look at the Students table, find the specific students associated with each family, sort them by their birthday, and return their full name:
Copy link
Member

Choose a reason for hiding this comment

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

Maybe "...and return the one student with the earliest birthday"?

Copy link
Member

@dsagal dsagal left a comment

Choose a reason for hiding this comment

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

Thank you! Looks good, good to merge!

@MichaelNickolas MichaelNickolas merged commit 0362876 into master May 13, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants