0

Variables

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

null
    • Fred
    • 1 yr ago
    • Reported - view

    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.

      • giuseppe
      • 1 yr ago
      • Reported - view

       Thank you, but it doesn't work. Unfortunately, it doesn't work well because Ninox returns me all Lead Update. I think maybe (forgive me if I'm wrong, I'm not an expert) with this formula Ninox finds the last appointment by not discriminating by name. I would like only leads that have a current appointment to not become OLD. In the Meetings table there is a field called "With" which is a formula in which the name of the lead with whom there is the appointment in question appears

      • giuseppe
      • 1 yr ago
      • Reported - view

      "Quando" is the date field, it seems like "WHEN"

      • giuseppe
      • 1 yr ago
      • Reported - view

       In the formula I replaced "Quando" with "With"

    • Fred
    • 1 yr ago
    • Reported - view
     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.

      • giuseppe
      • 1 yr ago
      • Reported - view

       Thank you, i got it. thank you, I got it. I apologize if I did something wrong in the description. I also think I have solved the problem. The only thing I can't solve is that the formula, in leads where there are no appointments, always returns an "Update" value

    • Fred
    • 1 yr ago
    • Reported - view
      • giuseppe
      • 1 yr ago
      • Reported - view

       Yes sure:

       

      let currentMeeting := last(Meetings order by Quando);

      if days('Data Ultima modifica', today()) > 7 and (Stato = 1 or Stato = 6 or Stato = 7) and

      currentMeeting.date(Quando) < today() then

      styled("OLD", "red")

      else

      styled("Update", "")

      end

      • Fred
      • 1 yr ago
      • Reported - view

      thinking about it, if you don't have a date then a "null" value will always return a false/else since you don't have anything to return a true value.

      What do you want to happen if there is no records in Meetings?

      • giuseppe
      • 1 yr ago
      • Reported - view

       I would like it to return the value "Update."

Content aside

  • 1 yr agoLast active
  • 10Replies
  • 107Views
  • 2 Following