Do dynamic form rules apply to Actions?

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
I am trying to create an action so that when a record is added in the [Project Table] it automatically creates an activity for its setup in the [Activity Table]. Though, the field in the [Activity Table], [Time Logged] is a numeric field. I cannot use the "Write Value" option to write in the default value for [Time Logged] as text data is not compatible. Do dynamic form rules still apply in actions? So that if I had a dynamic form rule for the [Activity Type] "setup" that filled in its default value it would still fill in its default value even though it was created through an action?
Photo of Jordan

Jordan

  • 1,574 Points 1k badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
Form Rules only apply when humans (or perhaps other species on other planets using Quick Base) edit the record in edit mode.

I suggest that you focus your question back on this


Though, the field in the [Activity Table], [Time Logged] is a numeric field. I cannot use the "Write Value" option to write in the default value for [Time Logged] as text data is not compatible. 

I'm not understanding why you feel that a form rule can do something that can Action cannot do.
Photo of Jordan

Jordan

  • 1,574 Points 1k badge 2x thumb
I thought perhaps form rules would still apply when a record is created through an action. Is there then another work around for being able to write in a value for [Time Logged] when it is a numeric field? 
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
An Action can write any field type.

Do you have a source field for what you are trying to write?  

Is the issue that you have a duration field and you want to write say Minutes?  If so make a new field called [Duration in minutes] with a formula of ToMinutes([my duration field])
Photo of Jordan

Jordan

  • 1,574 Points 1k badge 2x thumb
The issue is that there is no source field project record, that is why I am using the write value option. There is a minimum amount of [Time Logged] based on [Activity Type] that everyone is aware of. So I would like to pass the that minimum [Time Logged] through the action. This way people do not have to go create the activity after they create the project record in the project table. 
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
If there a a minimum amount of time logged based on something that only exists in peoples heads, why not take that knowledge "that everyone is aware of" and turn it into a numeric formula field.
Photo of Jordan

Jordan

  • 1,574 Points 1k badge 2x thumb
Would it still remain editable then? So if an activity did take longer then the minimum they could still change it?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
Well you can have an action fire when the value is less than it should be to change it to the minimum value.
Photo of Jordan

Jordan

  • 1,574 Points 1k badge 2x thumb
So since I can write in the Activity Type even though it has no source since it is a drop down text menu, I can have a separate action in the Activity Table for that Activity Type that will modify it to the minimum value if its below a specific threshold?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
If I understand the use case here, you are saying that there is a minimum time for each activity type.

There are at least two solutions.

On would be to have a formula calculate the time and have it be a formula which would use the higher of the time entered (which would be your existing field) and the minimum time for that Activity.  That would be my suggested method.

You could also use Actions, but that is a very obscure method for future support of the app. 
Photo of Jordan

Jordan

  • 1,574 Points 1k badge 2x thumb
I agree using multiple actions to accomplish this seems very wishy washy. So in your other idea, I could have another text field in the activity table, and have the action pass the value I am writing to it. Then also have the original input field remain in the form. Though, when viewing the form have another field be displayed that is a calculation. The calculation will determine which is higher and display that one.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
I am suggesting to not use Actions at all.

Just have two fields.

1. A data entry field for the time
2. A final Time calculated field which will take the greater of the min time and the time entered. 

Use the latter field in view mode on the form and on reports
Photo of Jordan

Jordan

  • 1,574 Points 1k badge 2x thumb
I was able to get this working with this idea,
Thank you so much!
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
Great to hear that you used the right tool for the job. Just because you own a hammer does not mean every problem is a nail.  Sometimes you need to use the cross-head screwdriver.