Discussions

Expand all | Collapse all

Help with a custom data rule formula

  • 1.  Help with a custom data rule formula

    Posted 09-23-2020 14:43
    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
    ------------------------------


  • 2.  RE: Help with a custom data rule formula

    Posted 09-23-2020 18:02
    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
    ------------------------------



  • 3.  RE: Help with a custom data rule formula

    Posted 09-24-2020 14:57
    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
    ------------------------------



  • 4.  RE: Help with a custom data rule formula

    Posted 09-24-2020 16:53
    See if this works for you:
    If (
    [Not available] = "",
    "",
    "Please check that your items are available during your event dates. Thank you!"
    )

    ------------------------------
    Brad Lemke
    ------------------------------



  • 5.  RE: Help with a custom data rule formula

    Posted 09-24-2020 21:49
    If Brad's suggestion does not work, try this


    See if this works for you:
    If (
    ToText([Not available]) = "",
    "",
    "Please check that your items are available during your event dates. Thank you!"
    )

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 6.  RE: Help with a custom data rule formula

    Posted 09-25-2020 10:52
    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
    ------------------------------



  • 7.  RE: Help with a custom data rule formula

    Posted 09-25-2020 11:02
    Edited by Mark Shnier (YQC) 09-25-2020 11:03
    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
    ------------------------------



  • 8.  RE: Help with a custom data rule formula

    Posted 09-25-2020 12:54
    Oh shoot. Sorry! 

    Now it works, but once the error comes up and they check it and the dates are okay, how do they save? It wont let me save.

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



  • 9.  RE: Help with a custom data rule formula

    Posted 09-25-2020 13:00
    I think that we are really not understanding at all what is in that field when you do want to allow save and when you do not.

    Maybe Custom data Rules is the wrong tool for the job.

    Can we start over and have you say in words what you are trying to do, with an example or when you want to allow save and when you do not.

    You should also make an example for your self in the actual app so you know what is actually in that field.
    Mark

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 10.  RE: Help with a custom data rule formula

    Posted 09-25-2020 13:32
    Okay. I just want a message to show up when they click the save button to say to double check the dates. I always want them to be allowed to save. Or maybe it should be when they enter something in the last field the message could come up. Its just a reminder message, not something that allows or doesn't allow them to do something.

    Is there such a thing thats just a reminder message that you can have come up? Maybe the custom data rules isn't right, because its not really a rule.

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



  • 11.  RE: Help with a custom data rule formula

    Posted 09-25-2020 13:47
    Right, a Custom data rule is exactly designed to block the save with a message, or allow the save.  Period.

    I think you should just make a rich text formula field to display on the form with words in color.


    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 12.  RE: Help with a custom data rule formula

    Posted 09-25-2020 15:41
    Okay got it. I'll do that. Thanks for your help!

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