Variables
![](https://s3-us-west-2.amazonaws.com/media.forumbee.com/i/0f49064d-b627-4e9e-90aa-54b4dba81f7f/h/547.png)
Hi, I have a "Leads" table where I record the leads of my business. Associated with this is another table where I record appointments with leads ("Meetings"). In the "Leads" table I have a field that displays a colored "OLD" if certain conditions are met: 1) if the lead is older than 5 days and if no action has been done in the record in these 5 days. Otherwise the formula is triggered.
I would like to add a variable related to appointments, i.e., I would like it to not trigger the action even if there is an appointment in progress, i.e., it should not trigger at least until the day of the appointment. How can I do this? Thanks
This is the formula I currently have:
if days('Data Ultima modifica', today()) > 4 and (Stato = 1 or Stato = 6 or Stato = 7) then
styled("OLD", "red")
else
styled("Update", "")
end
10 replies
-
If Meetings is a reference field to the Meetings table and Quando is the name of the appointment field then you can try:
let currentMeeting := last(Meetings order by Quando) if days('Data Ultima modifica', today()) > 4 and (Stato = 1 or Stato = 6 or Stato = 7) and currentMeeting.date(Quando) >= today() then styled("OLD", "red") else styled("Update", "") end
Since Meetings is a N:1 to Leads, Ninox will always return an array of records if you reference it, so I added line 1 to get the record with the latest appointment.
-
said:
Unfortunately, it doesn't work well because Ninox returns me all Lead Update.According to your picture, you have a table view that could be from a reference field or view element. I took that to mean that you are in another table, probably Leads, and what you are showing are only showing records in Meetings that are related to the record in Leads.
Since you are using a reference field, you are only seeing related records, not all Leads records. I do not know how the records are related, so I was using the Quando field since you said:
said:
I would like it to not trigger the action even if there is an appointment in progress,I hope you were able to modify it to make it work.
-
said:
The only thing I can't solve is that the formula, in leads where there are no appointments, always returns an "Update" valueCan you post your new code?
Content aside
- 9 mths agoLast active
- 10Replies
- 103Views
-
2
Following