Java Script not saving two variables (date & Time)

Avatar

Avatar
Validate 1
Level 1
bryceh57660644
Level 1

Like

1 like

Total Posts

16 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
bryceh57660644
Level 1

Like

1 like

Total Posts

16 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
bryceh57660644
Level 1

08-06-2020

I have two pages with the same issue.  I am trying to save date and time in two separate spots. When I test if the data is being captured in the form via an Alert() or debug mode, I am seeing that the values pass through, but they are not being saved

 

In the form:

bryceh57660644_1-1591667743368.png

 

Java Script

bryceh57660644_0-1591667691757.png

 

In the script after the web page:

bryceh57660644_2-1591667850486.png

 

Here are the page variables:

bryceh57660644_3-1591667890453.png

 Data Schema:

bryceh57660644_4-1591667941352.png

 

These variables have worked in the past but I am not sure what I have done to stop them from working.

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 50
MVP
Jyoti_Y
MVP

Likes

89 likes

Total Posts

123 posts

Correct reply

55 solutions
Top badges earned
Boost 50
Shape 1
Boost 5
Give Back 5
Give Back 3
View profile

Avatar
Boost 50
MVP
Jyoti_Y
MVP

Likes

89 likes

Total Posts

123 posts

Correct reply

55 solutions
Top badges earned
Boost 50
Shape 1
Boost 5
Give Back 5
Give Back 3
View profile
Jyoti_Y
MVP

09-06-2020

Hi,

 

There are two points which you can check:

1) Value of variable ID, as you are doing insert or update operation, are you passing id value in your xtk.session.Write. If yes, then please check what is the value generated.

2) Typecast string variables to date and time data type.

 

Thanks.

Answers (2)

Answers (2)

Avatar

Avatar
Contributor
MVP
Anita_p
MVP

Likes

119 likes

Total Posts

119 posts

Correct reply

29 solutions
Top badges earned
Contributor
Shape 1
Ignite 3
Ignite 1
Validate 1
View profile

Avatar
Contributor
MVP
Anita_p
MVP

Likes

119 likes

Total Posts

119 posts

Correct reply

29 solutions
Top badges earned
Contributor
Shape 1
Ignite 3
Ignite 1
Validate 1
View profile
Anita_p
MVP

11-06-2020

Hi @bryceh57660644 ,

Check below in your script:

  •  The variable definitions are correct as per what you have declared in the form as storage
  •  try adding  "_key" in your xtk.session.write function as below:

             Screen Shot 2020-06-11 at 8.24.18 pm.png

Here "v_id" would be IDs in your case as you are trying to save the values for a particular record and I believe it is missing currently , hence you are not able to see the value getting inserted/updated.

 

Hope this helps.

Thanks.

 

 

       

Avatar

Avatar
Boost 5
Level 2
isahore
Level 2

Likes

8 likes

Total Posts

36 posts

Correct reply

11 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 5
Affirm 3
View profile

Avatar
Boost 5
Level 2
isahore
Level 2

Likes

8 likes

Total Posts

36 posts

Correct reply

11 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 5
Affirm 3
View profile
isahore
Level 2

08-06-2020

Hi @bryceh57660644 ,

 

Can you check in the javascript using logInfo(typeof <<variableName>>); what is the data type of the variables that are captured from the ctx.vars variables? Most probably the variables contactdate and contacttime in your javascript are of type String. You would need to typecast them before saving into your table.

Let me know if that helped?