You are viewing limited content. For full access, please sign in.

Question

Question

Calculation in table doesn't update until add new row

asked on June 26, 2018

I have a DateDif calculation on a field in a table - =DATEDIF(INDEX(Dependent_Information_1_1.DOB,ROW()),Date_of_Injury,"Y") It will not fill in the age until another row is added. It should calculate for the current row. Here is how it looks before and after I add another row.


 

0 0

Answer

SELECTED ANSWER
replied on August 29, 2018

I know it's an old post, but if you add a .trigger('change') on that particular field, this will force the calculation to run.

1 0

Replies

replied on June 26, 2018

Hi Kathy,

 

I tried to reproduce the issue with Forms 10.2.1.255, 10.3.1.552, but I cannot reproduce it. Below is what I did to try to reproduce it.

I used a separate Date field as Date_of_Injury; and inside the table, Single Line field for name, Date field for DOB, and a Number field for age(time of injury) which contains the field. I also tried a Single Line field for age(time of injury).

I have the Date_of_Injury filled always as today(current_date). No matter I typed in the DOB, or selected a date from the calendar, or populated the DOB from lookup rules, it works for me: every time after a date is filled in for DOB, the age is calculated in the current row.

 

Which version of Forms are you on? How do you get Date_of_Injury? I feel there might be a reference to get Date_of_Injury which prevents the calculation for your side.

0 0
replied on June 26, 2018

Hi Ming,

 

There is an original submission form that creates a task with this form. The date of injury field from the original submission form is used on this form, using the values from the original submission. This field is used for two other calculations that work just fine, it is only when trying to do the calculation in a table that produces this issue. I tried putting a new date in the Date of Injury field and it did not change the experience. This is Forms 10.3.1.552

0 0
replied on June 26, 2018

Hi Kathy, 

 

Thanks for the information. I tried to parse the data from previous data it works for me too. Ok, let's try to eliminate the factors that could lead to this.

1. What is the field type for your Date of injury field? and the field type for your "time of injury"? (Maybe this won't be the root cause, but will get me a better idea to reproduce/find the issue.)

2. On your Forms Designer, do you have the same error? I mean while you design the form, do you see the error on that page? After you add the formula, refresh the page to try to validate the formula.

For example, I don't have an error:

If there's an error:

I ask this because seems in my form, there's no that error message shown. I want to check whether we have the formula with correct variables(also correct type variables) already validated.

 

3. Do you have similar named variables? Could you help me double check the variable names are correctly mapped to the variables you want?

Dependent_Information_1_1.DOB

Date_of_Injury

Check the fields you filled with the data, and check the corresponding variable information.

I ask you this is because that I saw you have the table as "Dependent_Information_1_1", seems to me that you have three tables (you might have deleted some of them), one is "Dependent_Information", another is "Dependent_Information_1", can you help me check that the table you are referencing is the one you are currently on?

 

Hopefully we could find the root cause soon.

0 0
replied on June 26, 2018 Show version history

Hi Ming,

 

I verified the table name and field types - 


Date of Injury is a date field

I do not see the error in forms designer. This table is hidden until the field Number of Dependents has a number in it. The error appears when I add a row on my form. The calculation is resolved when I add another row. If a row is added and then deleted the calculated amount remains.

 

I think

I think you are correct, it has something to do with how the data is in the field. When I do it in preview mode and add the date, it works fine. When I do it with my task, I have to add a row before it calculates.

Thank you for all your assistance. I know there is logic in here somewhere :-)

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.