Search box and Formula creation

Hello, I am sending this message from mobile. I use mobile more.

Tye search box on mobile, for me, is too small.
I find it hard to view the entire text of what I am searching for. Please, try to enlarge the search box for the mobile version

Secondly, I don’t know how to create formulas.
I need help here. Please.

I have 2 tables one for Contacts and One for Interactions.

Interactions table contains the following columns ( Name - linked to Name column in Contacts table, Date of Interactions, Type of Interactions - be it email, call, to do etc , and Notes about every Interactions)
Each Interactions is tied to a particular person ij Contacts table.

Please,I want a formula, or script or anything, such that each time an Interaction is logged in Interactions table linking to a particular person in Contacts table, a column called ‘Last Contacted’ in Contacts Table is automatically filled with the last Interactions date of that particular person.
So a person can have about 3 Interactions in Interactions table that took place in June 13, July, 12 and April 10.
I want July 12 , to be automatically filled in the Last Contacted column of Contacts table.

Is that impossible?

I will attach pictures below for easier understanding

I will send 2nd picture also

Picture of Interactions table

Hi Kingsley!

You can use the following formula to find the Last Contacted date for a Contact.

MAX(Interactions.lookupRecords(Name=$id).Date)

First, we use lookupRecords to find all records in the Interactions table where this Contact is listed in the reference column, Name.

We use dot notation to pull the value from the Date column for each of these records.

Finally, we use MAX() to find the latest date.

Read through our article on Using References and Lookups in Formulas, linked below for a more in-depth walk through of how these functions work!

Thanks
Let me apply the formula and see if it works.
Also, please consider that feedback of expanding the search box in the mobile version.

Is there any AI in grist that we can use to help us best generate a conversation for better follow up based on previous interactions we have had with a prospect?

I applied the formula in my Last Interacted Column in Contacts, nothing happened.
I want the column ’ Last Interacted" in contacts table to show me the last date I had interactions with that particular person based on records in Interactions table.

Please

Hello
I was able to apply the formula correctly and it worked. I applied the formula on the formula bar. I was applying it on cell and it didn’t work.

Thanks for your help you are amazing.

But I noticed the date format isn’t the way I want. If there’s no way to change it,thats ok :ok_hand: :slightly_smiling_face:.

Also,please I need help with another formula.

I have a column for birthdays. I want scenario whereby each morning those whose birthdays are of that day,comes on top of the table.
Any means of doing it?

You can change the Date format by changing the column type to Date then selecting a format from the dropdown.

If you have a column containing Birthday dates, we can add a helper column that returns true if today is someone’s birthday. Then sort by this helper column so those celebrating birthdays today appear at the top.

Add a new column with the formula;

$Birthday.month == TODAY().month and $Birthday.day == TODAY().day

This formula compares the date in the Birthday column to the current date ( TODAY() ). Specifically, it compares the month value in the Birthday column to the current month and then compares the day value in the Birthday column to the current day. If both match, the formula returns true. If the month and day do not match, the formula returns false.

We can set the column type to Toggle and format it to return a simple check when true.

Then, apply a sort from Z-A so true values appear at the top of the table.

We are working on AI for formula assistance. You’ll be able to tell AI what you need and it will help write formulas for your document. For example, you could tell it you want to know who is celebrating a birthday today and it would be able to help write the formula! That is coming soon so keep an eye out for an announcement :eyes: It is specifically for writing formulas so it would not be able to generate a conversation based on previous interactions. That is a very cool idea. I’ll share it with the team.

I shared this feedback with the team as well!

Thanks,
Natalie

Oh.
Thank you so much.
I appreciate your effort to create the formula.
It worked as you described :hugs::hugs:
You are making me fall in love with grist again.
It seems you respond only once in a day( in Nigeria where I am, I get the response email in the evening.:hugs::hugs:

The date format for last contacted column didn’t work as expected.

I tried changing the date format, it auto-populated the the cells with no last contacted date with 1970-01-01. I couldn’t change the column type to date. The formula only allowed for “Any” column type.

I don’t know if it is a problem from my end.
I attached pictures below.

Also, the AI on the roadmap, I hope it will be able to write formulas just like you.
I tried creating this formula on ChatGPT ans Bing ChatGPT, they gave complex means of achieving my goal.

Yours was simple and straightforward.:hugs::hugs:

Of course, when I max out my 5000 on free version, I will upgrade.

But 100k limit is somehow a limitation, in my opinion. I look forward to expecting an increase in no of rows.
I can log many as 100 interactions for one person.

You are amazing and so is your company.

picture of error column type

Try this updated formula for Last Contacted:

all_contacted_dates = Interactions.lookupRecords(Name=$id).Date
return MAX(all_contacted_dates) if all_contacted_dates else None

It’s the same initial formula (Interactions.lookupRecords(Name=$id).Date) which finds all records in the Interactions table for this particular contact. Then pulls the Date value for those records. We assign this list of dates to the variable all_contacted_dates.

We return MAX(all_contacted_dates) if records exist in that list. If no records were found with our lookupRecords function, then the formula returns None / a blank cell, rather than the default 1970 date.

That’s odd! It should allow you to change the type to date. Could you share your document with support@getgrist.com as OWNER and I can take a closer look.

Thanks,
Natalie

Hello I tried the new formula, it showed Syntax Error for Last Contacted column.

The previous formula is working perfectly okay.
It does pull up last Interactions date from Interactions table.
The only issue is that the date format is YYYY-MM-DD. I want to change the date format. Each time I do so, the cells with no last contacted date auto popuplate with 1970…

I did share the document

Please, is there a formula or a way I can make the “Name” column such that if I am entering similar names, it will send a signal that will let me know that it looks like I already have this contact.

Also, I am really concerned about limit of 100k.:smiling_face_with_tear::smiling_face_with_tear::smiling_face_with_tear:
I wish to stay long term with grist.
But the 100k limit means that at some point I will have to leave grist.for another tool?
Excel can house 1m records in one sheet.

Is upgrade in record limit impossible in grist?
Let me know so I can look for another tool

Hi Kingsley!

Different column types react differently to values of None. Date columns default to the 1970 date. That’s why the longer formula is necessary for dealing with those blank values. In order to format the date, you must set the column type to Date, then you’ll be able to select a Date format in the dropdown below column type. Using the formula below with the Date type column will eliminate those default 1970 dates and simply set those to blank values.

all_contacted_dates = Interactions.lookupRecords(Name=$id).Date
return MAX(all_contacted_dates) if all_contacted_dates else None

You can use conditional formatting to make duplicate names stand out. You can add a conditional style under the Column tab of the Creator Panel. Look for the green ‘Add conditional style’ text under Cell Style.

Add a new conditional style with the following conditional formula:

len(Contacts.lookupRecords(Name=$Name))>1

This formula looks up all records in the Contacts table where the value in the Name column matches. len() counts the number of records in that list. A single record will always match itself. We want to know if it matches more than one so if len() > 1, this formula returns true and our conditional formatting applies. In the screenshot below, Natalie appears twice under Name so the cell turns orange.

On the Pro plan, we say documents may have about 100,000 rows but this a rule of thumb. The actual limit depends on the number of tables, columns and the average size of data in each cell. A better estimate of your document size is found under Raw Data. You will see a Data Size indicator which gives a much better idea of how much data your document contains. On the Pro plan, this limit is 20MB. A document with 200,000 rows and 12 numeric columns would reach that limit. Note that attachments are counted separately. Attachments plus data in a single document are limited to 1GB on all plans.

Read more about limits here: Limits - Grist Help Center

Supporting larger databases is on our product roadmap and something we are researching currently. You can follow it at the link below.

If you have data tables that do not contain formulas and the data is not used elsewhere in formulas, you could consider creating an On-Demand table. This allows you to store more data. Read more about on-demand tables here: On-Demand tables - Grist Help Center

When a column is added in one widget, it is added to the underlying data table but not added to any other views of that data. If you add a column to a table widget, it will not automatically be added to a card widget using the same underlying data but you can edit a card and add additional columns to its view by clicking the green ‘Edit Card Layout’ button under the Card tab of the Creator Panel.

image

Then, click the ‘Add Field’ button at the upper-left of the card widget. Select the new column from the dropdown.

You can then drag and drop the field to the desired location within the card view.

Be sure to click the green ‘Save Layout’ button to save your changes.

Thanks!
Natalie