cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Brendan1
Frequent Visitor

sequencing 24 hour time for a dropdown

Hi Fellow Makers!

 

I am trying to sequence set of values to represent 24 hour time in 15 minute increments.  Here is my current approach:

 

ForAll(
    Sequence(
        96,
        0,
        0.25
    ),
    Concatenate(
        First(
            Split(
                Text(Value),".")
                ),
                ":",
                Switch(
                    Last(Split(Text(Value),".")),
                    "25","15",
                    "50","30",
                    "75","45",
                    ""
                    )
                    )
)

 

Problem 1: the concatenate function does not like my First() statement.

Possible Problem 2: I am not sure if I can use a Switch() inside a concatenate function.  

 

 

Can anyone point me in the right direction?

 

 

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Brendan1 :

Please try:

ForAll(
    Sequence(96,0,0.25),
    Text(RoundDown(Value,0),"00")&":"&Text(Mod(Value*60,60),"00")
)

Best Regards,

Bof

View solution in original post

3 REPLIES 3
Brendan1
Frequent Visitor

After a bit more tinkering, I got to this code which gives me "almost" the desired result:

 

 

ForAll(
    Sequence(
        96,
        0,
        0.25
    ),
    Concatenate(
        Text(
            First(
                Split(
                    Text(ThisRecord.Value),
                    "."
                )
            ).Result,
            "[$-en-US]00"
        ),
        ":",
        Switch(
            Last(
                Split(
                    Text(ThisRecord.Value),
                    "."
                )
            ).Result,
            "25",
            "15",
            "50",
            "30",
            "75",
            "45",
            "00"
        )
    )
)

 

One thing I can't make it do though, is display the single digit hour value as double digits  i.e. 1:00AM shows as "1:00" instead of "01:00".  I thought this was what the "[$-en-US]00" text format string would achieve, but it doesn't seem to work.

 

If anyone has an idea on how I could modify this to change to double digit hours, I would really appreciate it.

 

 

Thanks.

Hi @Brendan1 :

Please try:

ForAll(
    Sequence(96,0,0.25),
    Text(RoundDown(Value,0),"00")&":"&Text(Mod(Value*60,60),"00")
)

Best Regards,

Bof

View solution in original post

Brendan1
Frequent Visitor

Works perfectly @v-bofeng-msft !  Thanks for your help.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,630)