Doubt with date and day of the week

My app has an app variable called Weekday.

I have another 7 pages in the app, numbered 1 through 7, one for each day of the week.

I have a button on the main page and by clicking this button i want the app to switch to the day of the week screen. For example: if Current Date is Sunday then it should call page 1, if Current Date is Wednesday then it should call page 4.

I’m not a programmer and I have no idea how to do this.

Can anyone help?

Hi! I think you’ll get what you want with either FORMAT_DATETIME_LOCAL(NOW(), "E") or FORMAT_DATETIME_LOCAL(NOW(), "e") :slight_smile: However, “open page” does not allow the use of formula so if you insist on having separate pages for each weekday (I would recommend having just one page and getting data dynamically), you’ll have to do the navigation via using several “if” flow functions chained to check which page to open.

1 Like

Cool. Immense gratitude for your help. I researched your solution and used the following strategy:

In Global Canvas I created an Application Variable called “urlWEB” of type WEB Url to receive a different address for each day of the week. I also created another application variable named DayOfWeek, which is of type Text.

On the main screen I let the user have the option to choose the day of the week or automatically go to the current day. So I have a button that has dynamic content and that when clicking takes the user to a page that is the page for the current day of the week, and I also have a button for each day of the week, allowing the user to go to another day of the week. week as you wish.

The formula I used, with adaptations for Brazil, is as follows:

REPLACE_ALL( REPLACE_ALL( REPLACE_ALL( REPLACE_ALL( REPLACE_ALL( REPLACE_ALL( REPLACE_ALL(FORMAT_DATETIME_LOCAL(NOW(), “dddd, DD/MMM/YYYY”), “Saturday”, “Sábado”) , “Sunday”, “Domingo” ), “Monday”, “Segunda-feira” ), “Tuesday”, “Terça-feira” ), “Wednesday”, “Quarta-feira” ), “Thursday”, “Quinta-feira” ), “Friday”, “Sexta-feira” )

So my control that directs the button to the correct page is based on this formula above.

MEVI, Immense Gratitude for the NORTH you gave me.

2 Likes