Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Help with formula

Torabi
Explorer
0 Likes
3,822

Hello,

To display today's date, I have used this formula:

dump2024-06-11.png

The result will be: 11 Jun.
What formula should I use to display tomorrow's date (12 Jun) or yesterday's date (10 Jun)?

Hello,

To display today's date, I have used this formula:

dump2024-06-11.png

The result will be: 11 Jun.
What formula should I use to display tomorrow's date (12 Jun) or yesterday's date (10 Jun)?

11 REPLIES 11
Read only

marihirvi4
Product and Topic Expert
Product and Topic Expert
3,729

You can use ADD_DURATION and SUBTRACT_DURATION together with FORMAT_DATETIME_LOCAL to format the date:

marihirvi_0-1718876724283.png

 

Read only

0 Likes
3,700

Hi Marihirvi,
Thanks, it worked perfectly.
I have two more questions please:
1. Now when I use formula in my Soft tabs to display (yesterday, today and tomorrow) dates, (20 Jun, 21 Jun and 22 Jun) is displayed.

What should I add to the formula NOW("D MMM") to display today's date with label: Today?

photo-2024-06-21-1.png

2. When I launch the app, I want the Today tab to appear in the middle of the screen by default. Right now I have to swipe left to see it.

Thanks in advance for your help

Read only

0 Likes
3,648

You mean to look like this:

Dan_Wroblewski_0-1719209063664.png

NOW("D MMM") + " - Today"



--------------
See all my blogs and connect with me on Twitter / LinkedIn
Read only

0 Likes
3,607

Hi Dan,
Thanks for your reply.

No, I mean it like this:

Today.png

Read only

0 Likes
3,581

So can't you just make it static text to "Today"?




--------------
See all my blogs and connect with me on Twitter / LinkedIn
Read only

0 Likes
3,646

For the spacing, do you mean something like this:

Dan_Wroblewski_1-1719209338100.png

If you open the style for the soft tab you can play with the alignment:

Dan_Wroblewski_2-1719209418374.png

 




--------------
See all my blogs and connect with me on Twitter / LinkedIn
Read only

0 Likes
3,607

Thanks for your reply
No, it's not about spacing!
Right now the first tab is visible on the left and after it comes the second tab and third and so on.

Today2.png

What I want is that "Today" should always be visible in the middle of the screen and when you want to see other days, then you can swipe to the right or to the left.
Like this:

Today3.png

Read only

0 Likes
3,577

Hmm, well you can put the softtabs in a scroll view and the user can then see all the tabs by scrolling, but I don't see a way of putting Today in the middle. You can use the Layout > Position property to reposition Today to the middle of the visible area, but then you'd have to create your own scrolling capability (not really scrolling more like moving).

You could simply start with yesterday, today and tomorrow and add a previous button and a later button to, for example, remove the last item and add a new item to the end of the list. This would be pretty easy to do.

As far as I know the position of the scrollview is not retrievable and there is no property to set the position of the scroolview. 




--------------
See all my blogs and connect with me on Twitter / LinkedIn
Read only

0 Likes
3,529

Thanks Dan for your reply.
Ok, but what formula should I use on the left button and the right button?

Torabi_0-1719579547396.png

Read only

0 Likes
3,510

I'm not clear what you would like to do or how you want the softtab to work or what to display. Perhaps it would be helpful to show a little more of what you want.

In the meantime here is one behavior you could create:

2024-06-28_16-31-50.gif

I created a page variable that initially has today's date and the soft tabs use formulas (as Mari showed above) to display yesterday, today and tomorrow. The previous button then simply updates the page variable to yesterday with a "set page variable" flow function and the following formula:

ADD_DURATION(pageVars.CenterDate, -1,"days")

The next button is the same except it is +1.

We could play with the spacing so it does not resize with every new date, or we could show more dates, or we could keep the selected tab more logical, so if the today tab is selected and we click "Next" the first tab would now be selected. You could also have a date picker to move more than 1 day at a time.

I think you can get almost anything you want. Just let me know what precisely you want it to look like, and how the content of tabs should respond, and I'd be happy to help further.

 😺

 




--------------
See all my blogs and connect with me on Twitter / LinkedIn
Read only

0 Likes
3,410

Thank you so much Dan for wanting to help me.
What I want to do is connect a Google sheet via rest API to Soft tabs. The connection with rest API works well, but want to connect it to a table and control it via Soft tabs
To give you more understanding about what I want to do, I can send you an example as a gpg-fill.
Where can I send it?