Jump to content
  • 0

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])

Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 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

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.

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

Link to post
Share on other sites
  • 0
On 8/10/2018 at 8:18 PM, kvarjavand said:

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.

Hi @kvarjavand,

Formula field doesn`t support Datepart(week) as far as I know.

You need to use a workaround solution from this post:

Hope this helps.

Regards,

vitalikssssss

Link to post
Share on other sites
  • 0

Thanks Vitalikssssss for sharing. The solution looks great and I will most likely use it in some other scenarios I may be needing. FYI given the limitation, back in August my workaround was to use triggered actions to determine day of the week and it has been working fine so far. I will be happy to share a screenshot of it if you or anyone else would like to see it.

Link to post
Share on other sites
  • 0
On 10/25/2018 at 6:47 PM, kvarjavand said:

Thanks Vitalikssssss for sharing. The solution looks great and I will most likely use it in some other scenarios I may be needing. FYI given the limitation, back in August my workaround was to use triggered actions to determine day of the week and it has been working fine so far. I will be happy to share a screenshot of it if you or anyone else would like to see it.

Hello Kvarjavand,

Can you please share a screenshot how did you find day of the week using triggered action ?

Thanks

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...