Help

Second field should be filled based on the value of the first field

Topic Labels: Automations
Solved
Jump to Solution
940 6
cancel
Showing results for 
Search instead for 
Did you mean: 
charliec
5 - Automation Enthusiast
5 - Automation Enthusiast

Hello everyone,

I’m here to ask you about a specific use case for which my searches didn’t get me any good results.

I have a table of video documents where there is a duration field, with length written in the format hh:mm:ss.

I have a second field called duration format, in which I wish for 3 options to be available: under 30 min, between 30 min and 1h, over 1h.

Is there a way to fill this second field (duration format) automatically based on the value of the first field (duration)?

Thank you in advance for your help and answers!

Best regards to everyone!

Charlie

1 Solution

Accepted Solutions
TheTimeSavingCo
18 - Pluto
18 - Pluto

Would a formula field work? 

IF(
  Duration < 1800, "Under 30 minutes",
  IF(
    Duration < 3600, "Between 30 min and 1h",
    "Over 1h"
  )
)

Screenshot 2023-05-11 at 2.14.33 PM.png

See Solution in Thread

6 Replies 6
Joe_Svingala
6 - Interface Innovator
6 - Interface Innovator

Hi Charlie,

Is your second field a single select field?
If it is you could create a simple automation for when a field is updated & make sure it is pointed at your duration field, you can then create a conditional action for each of the conditions you listed above:

  • When Duration is less than 00:30:00,
  • the second one you would need two conditions when Duration is greater than or equal to 00:30:00, and less than or equal to 01:00:00
  • And When Duration is greater than 01:00:00

For each of these conditions you will want to use an update record action & use the record ID from the record that triggered the automation, then select the second field & use the option for each of your conditions. 

Hope this helps!

TheTimeSavingCo
18 - Pluto
18 - Pluto

Would a formula field work? 

IF(
  Duration < 1800, "Under 30 minutes",
  IF(
    Duration < 3600, "Between 30 min and 1h",
    "Over 1h"
  )
)

Screenshot 2023-05-11 at 2.14.33 PM.png

Hi @Joe_Svingala ,

Thank you very much for the time you took to answer.

If I correctly understand the last part of your message, and I use the record ID, doesn’t it mean I would need to do it for each record? So in that way I’m a bit lost.

Thanks again!

Best regards,

Charlie

Hi Adam @TheTimeSavingCo ,

Thank you very much for your answer too!

Wow, yeah! That works perfectly, thank you!

I really appreciate the help,

Best regards,

Charlie

No, so the way that this works in an automation is that the recordID pertains to the record that triggered the automation. In this sense, if you add a duration to a record, that record will trigger the automation & then its record ID will be used in the update record portion. Once the automation is live, any record that has its duration updated, will then subsequently have the second field updated with the selection you setup in the configuration.

Formulas will work, but you will be stuck with plain text as your output - this solution allows you to maintain a single select field & keep the color formatting that comes with it as well. 

charliec
5 - Automation Enthusiast
5 - Automation Enthusiast

Hello @Joe_Svingala ,

Thank you for taking the time to write this detailed answer and explanation, I appreciate it a lot! 😊
I think now I understand how the system you propose works, and the benefits.

To give more details to my use case: my final goal is to create an integration between Airtable and a WordPress website. The duration format column will serve as what’s called an attribute of products in WordPress/WooCommerce, and in that specific case, the attribute will be one of the filters by which the video documents can be filtered (duration format). That column will serve no other purpose.

Knowing that, do you think it’s necessary (or better) to use the method you propose, compared to a formula?

Anyway, thank you very much for your help, and I’m still going to try your method on a copy of the table, to see how it works!

Best regards,
Charlie