Modify Python formula Lightweight CRM

Hello,

First, in contact table/column “Due” i would like to display all interaction type (To-do, Email, Phone) by due date but my python level isn’t great.

Secondly, i would like to display in contact table another column with interaction type.

Is it possible and where can i search to do that ?

Regards

Frédéric

These both sound very achievable, though it’s hard to grasp exactly what you need to do. Can you share a sample document?

1 Like

nick, here is the best that i can achieve now :sweat_smile:

Nick, I think it’s ok now Lightweight CRM (copy) - Grist

Thanks, so it looks like you want the type of the oldest task to show up in the Contacts table?

Since this is already happening for date (Due column) and name (To-Do Items column), you can see that it needs a formula to pick the correct value. For date:

first_todo = Interactions.lookupOne(Contact=$id, Type="To-Do", order_by="Date")
return first_todo.Date

We can make some small modifications to get the Type:

first_type = Interactions.lookupOne(Contact=$id, Type="To-Do", order_by="Date")
return first_type.Type

And then we’ll need to change the column type to Choice and add in the choices (you can do this by copying and pasting from the Interactions.Type column). I’ve done this in your shared doc.

Really kind,

Sorry for that, in fact, i would like to see next actions to do (phone, To-do, Email, In-Person) in Type column and next programmed dates in Due column.

Hmm, the template you’re using is assuming “actions to do” would have the “To-Do” type, this is why there’s an additional filter on the above formulas: Type="To-Do"

The other types are meant to log interactions to keep a history. Of course you can organize things however you think works best.

If you get rid of the filter in each formula (as I have done in your shared document), it will show the earliest interaction of any time. Is that what you needed?

1 Like

That’s exactly that. Perfect.

Grist can be a really powerfull app with the right skills, like yours nick.

Really thanks a lot.

1 Like