Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Time with semicolon problem

Featured Replies

I have a time field (Time OnCPBP) in which I can set a script to

enter the current time; however when I want to enter the military

time manually, I use the Auto-Enter Calculated value specified as:

Let ( [ TheText=GetAsText(Time OnCPBP);

Reformat=(PatternCount(TheText;":")=0);

RawNumber=GetAsNumber(TheText) ];

Case(Reformat; Time(Div(RawNumber;100);

Mod(RawNumber;100) ;0);

Time OnCPBP))

This lets me enter the four digits and it inserts the semi-colon for

me (much easier) for my users....

Problem:

I have another time field (On CPBP #2) in which the calculated value

is specified as:

If (Event = "On CPBP #2"; Time), so whenever the "Event" field is "On

CPBP #2) the time gets entered automatically. The caveat is, I would

also like to enter the 4-digit method manually and format as above

but I'm having trouble combining the two calculations.

Any thoughts, not sure why this stumped me.

I thought something like:

If (Event = "On CPBP #2"; Time) +

Let ( [ TheText=GetAsText(Time OnCPBP #2);

Reformat=(PatternCount(TheText;":")=0);

RawNumber=GetAsNumber(TheText) ];

Case(Reformat; Time(Div(RawNumber;100);

Mod(RawNumber;100) ;0);

Time OnCPBP #2))

I guess my basic problem is how to "nest" these two formula together. Each works separately but I need them both in this field. Thanks to anyone!

Try something like:

Case (

Get (ActiveFieldName) = "On CPBP #2" ; ;

Event = "On CPBP #2" ; Get (CurrentTime) ;

On CPBP #2

)

  • Author

Thank you; that was a pathway I did not think of. I entered it as:

Case(Get ( ActiveFieldName ) = "Time OnCPBP#2";

Let ( [ TheText=GetAsText(Time OnCPBP#2);

Reformat=(PatternCount(TheText;":")=0);

RawNumber=GetAsNumber(TheText) ];

Case(Reformat; Time(Div(RawNumber;100);

Mod(RawNumber;100) ;0);

Time OnCPBP#2);

Event = "On CPBP #2"; Get ( CurrentTime );

Time OnCPBP#2)

.....and I get the usual error message "There are too many parameters in this function"

Any thoughts. I have used the actual field names here.

Thanks for the effort

This is not easy to read, but I think you're missing a parenthesis to close the Let() function.

  • Author

The Let() seems to work fine alone as.......

Let ( [ TheText=GetAsText(Time OnCPBP#2);

Reformat=(PatternCount(TheText;":")=0);

RawNumber=GetAsNumber(TheText) ];

Case(Reformat; Time(Div(RawNumber;100);

Mod(RawNumber;100) ;0);

Time OnCPBP#2))

....this allows me to manually enter a 4 digit number and it will place the colon in to create a military time.

For some reason, I can't seem to auto enter the Time, when the Event field="On CPBP#2"

....I can do this separately without the Let function but I can't get them to work together.

The Let() seems to work fine alone as.......

Let ( [ TheText=GetAsText(Time OnCPBP#2);

Reformat=(PatternCount(TheText;":")=0);

RawNumber=GetAsNumber(TheText) ];

Case(Reformat; Time(Div(RawNumber;100);

Mod(RawNumber;100) ;0);

Time OnCPBP#2)[color:red])

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.