Jump to content
  • 0
kvarjavand

Day of the week in table

Question

I understand we are not able to use the date formula for day of the week directly in a table field. I have managed to create a calculated field in a DataPage that uses a day of the week formula (see below for the formula used) which is working nicely and gives me the desired result on the DataPage. However, this is good for display only and I cannot use the result other than viewing it on the DataPage. 

Is there a way to pass the result from my DataPage calculated field back to a table (same table that the DataPage is connected to)? Or, is there anyway to get a working formula directly on the table that provides a number 1 through 7 for day of the week for a given date? 

The formula I am currently using on the DataPage and works well is:  DatePart(dw,[@field:XXXXX])

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

In the submission form where you add the values to the table, you can include an integer field, form element should be Calculated value  and use the same formula above

Share this post


Link to post
Share on other sites
  • 0

Thank you so much for your response, MayMusic. Just before receiving your response, I figured out how to get day of the week automatically added in a table using triggered actions. Triggered actions offers some very nice date functions/features, etc.  However, if your suggested approach works, it might be more efficient and/or I would like to make it work since it may come in handy for other use cases.

So, i just tried following your instructions and I cannot get this formula to work in a form field.  Please see screenshot shown below for the set up in a dummy form and table I just created and I keep getting "invalid formula." You can see on the left had side that the field Weekday has been set up and an integer, I have made the form field a Calculated Value field, and I believe I have referenced the Date_Entered field properly in the formula.

Any help will be much appreciated.

Kaveh

2018-08-07-18 16_01_48-Caspio.jpg

Share this post


Link to post
Share on other sites
  • 0

Franchiser, thanks for taking the time to look into this.  I see your test of this formula is being done in a DataPage and I had already been able to get it to work in a DataPage as well. The problem is that the same formula used directly in a Formula field in a table will not work. I was able to work around it by using a triggered action in the table and since triggered actions have a similar day of the week option, it works. However, the formula still will not work in a table field without a triggered action. Thanks again.

Share this post


Link to post
Share on other sites
  • 0
On 8/6/2018 at 8:52 AM, kvarjavand said:

Is there a way to pass the result from my DataPage calculated field back to a table (same table that the DataPage is connected to)?

A: Yes,  I believe you can. I was able to extract the dayOfWeek and put in an Integer field on a Submission Form DataPage.

DayWeekOnSubmissionForm.png.b7bf124520d0a344d4f27421d89a8e45.png

 

===

As for this one...

On 8/10/2018 at 10:18 AM, kvarjavand said:

The problem is that the same formula used directly in a Formula field in a table will not work

It's strange but I am also getting an error when I tried to put the exact same syntax on a formula field in the table.  I think it is best to contact Caspio about this issue.

 

Regards,

DN31337

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×