Forum Discussion

MeganHardison's avatar
MeganHardison
Qrew Member
5 years ago

Help with a custom data rule formula

I'm trying to add a custom data rule for a table that will come up with a message for the user. Can you help me figuring out whats wrong with this formula?

If (
[Not available] = true,
"Please check that your items are available during your event dates. Thank you!"
)

The [Not available] field is a lookup field, so I'm trying to say that if it contains any dates, to show this message. However, I'm getting an error that says that on the left hand side of the operator "=" is of type textlist while the expression true on the right hand side is of type bool. The operator "=" cannot be used with these types of expressions.

Thanks!


------------------------------
Megan Hardison
------------------------------
  • The syntax error is a field type mismatch.  The lookup field looks like it might be a multi-select field or some kind of text field and you are trying to use it as if it was a checkbox field.

    What is actually in the field you are checking against?

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • MeganHardison's avatar
      MeganHardison
      Qrew Member
      Hi Mark,
      Thanks for getting back to me. :-)

      The [Not Available] field is a lookup field. Its looking at a field in another table that's a summary field showing when the item is being used. I just want to say that if there's something in that field, I want the user to double check that its not being used during the dates they want it.

      Do you know if there's another way to do it?
      Thanks so much for your help!

      ------------------------------
      Megan Hardison
      ------------------------------
      • BradLemke's avatar
        BradLemke
        Qrew Assistant Captain
        See if this works for you:
        If (
        [Not available] = "",
        "",
        "Please check that your items are available during your event dates. Thank you!"
        )

        ------------------------------
        Brad Lemke
        ------------------------------
    • MeganHardison's avatar
      MeganHardison
      Qrew Member
      Got an error on both. Here's what they said below. Any other ideas? Thanks so much to you both for helping me!

      The first error: Formula Error -- Type Mismatch

      The expression [Not Available] on the left hand side of the operator "=" is of type textlist while the expression "" on the right hand side is of type text. The operator "=" cannot be used with these types of expressions.

      You may need to do one of the following to fix the problem:
      • Add a type conversion function.
      • Choose a different operator.
      The second error: Formula error -- Unknown function
      The function name IIf(bool, text, text) is unknown.


      ------------------------------
      Megan Hardison
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        In the second version, remove the extra I in IIF in the IF.  s/b IF not IIF.

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------
    • MeganHardison's avatar
      MeganHardison
      Qrew Member
      Okay got it. I'll do that. Thanks for your help!

      ------------------------------
      Megan Hardison
      ------------------------------