Calculated vs initial value calculations

9 צפיות
מעבר להודעה הראשונה שלא נקראה

Jamian Manton

לא נקראה,
12 באוג׳ 2020, 19:36:4512.8.2020
עד Orbeon Forms
Hi,

I'm interested in seeking more understanding regarding the difference between the result of Calculated Value fields and Initial Value fields in view mode in the Formula tab.

I have an eform that uses a dataset from an HTTP service for patient data, and at first I used the calculated field to manipulate the data into user friendly format, such as:
concat(fr:dataset('patient')/firstName,' ',fr:dataset('patient')/lastName)for the full name field and:
concat(fr:dataset('patient')/addr1,' ',fr:dataset('patient')/addr2,codepoints-to-string(10),fr:dataset('patient')/city,' ',fr:dataset('patient')/postcode)for the address.

These work fine in edit mode but when displayed in the view mode the results disappear. I know that a calculated field always tries to calculate regardless of the view but I would have thought that the calculation would still return the same result as this does not change. Can someone explain why the data in calculated fields with consistent data does not calculate? Is the dataset unable to be accessed in view mode?

I have since moved the calculations to the initial value field and set it to read only but its the older versions of the form that still display empty fields that are a concern to me and I can't logically see a reason why they do not show the calculated data.

I am on version 2018.1.2.201810050007 PE

Regards

Jamian Manton

bwallis42

לא נקראה,
12 באוג׳ 2020, 20:16:4912.8.2020
עד orb...@googlegroups.com
Hi James,
I don’t think the dataset is being populated when the form is viewed, I
think that only happens when the form is being edited.

If you do something simple in the calculated and initial value fields, say
‘current-time()’ then you will see the behaviour you expect. So the formulae
is running each time for the calculated field but no data in the dataset.

Brian…

--
Sent from: http://discuss.orbeon.com/

Jamian Manton

לא נקראה,
13 באוג׳ 2020, 1:36:4513.8.2020
עד Orbeon Forms
Thanks Brian,

I thought this might be the case.

Regards
Jamian
השב לכולם
השב למחבר
העבר לנמענים
0 הודעות חדשות