Casting a N/A value into an orbeon Date field and an Orbeon number field

Skip to first unread message

Dylan Strachan

Dec 10, 2020, 5:40:04 PM12/10/20
to Orbeon Forms
Hello All,

I am trying to cast N/A to date and number fields if they are null and if a question is selected as no. What I have right now is:

if($Control1 = 'No') then ($Control2 [string() castable as xs:string] = 'N/A') else .

With Control2 being a date field, and Control1 being a Yes/No radio button field. I also need this logic for Control2 if it were a number field. 

Normally we would set up logic to send N/A through the hide stream and we have done that before. In this case however we need the N/A to be able to be seen within the form as the agency using this form needs to be able to see N/A in the field upon printing.

Any help would be greatly appreciated!


Alessandro Vernet

Dec 11, 2020, 2:16:35 AM12/11/20
Hi Dylan,

Would you be able to create a simple form where you have those fields setup,
maybe with Form Builder on, so we can see and run
what you have? Then you can share with us here the link to the form, and
also attach the source to your message (data on
being publicly accessible, it can disappear at any time).

(I am a bit puzzled by Control2 being a date field, but sometime having a
value of "N/A". Obviously, that isn't a valid date, and would be unexpected
for a date field.)


Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Sent from:

Dylan Strachan

Dec 11, 2020, 5:53:56 PM12/11/20
Hello Allesandro,

I have created a Test form called Demo_NA_Functionality.

I need N/A to default to all fields if they are not answered. In some cases they will not be visible because of the logic put into the sections with dependencies on the answer to the Third party payer question.  Basically if upon form submission these fields are null I need them to display N/A.  this goes for every field after the Sample Insurance? field.

Thank you for your help and let me know if you need anything else.


You received this message because you are subscribed to a topic in the Google Groups "Orbeon Forms" group.
To unsubscribe from this topic, visit
To unsubscribe from this group and all its topics, send an email to
To view this discussion on the web visit

Alessandro Vernet

Dec 13, 2020, 10:25:22 PM12/13/20
Hi Dylan,

Got it, so you need the value of any field left empty to become "N/A" in the
data you submit. By "submit", are you referring to the `send()` in a
process? If so, you could maybe add to your process after you save the data,
but before the `send()`, something like:

ref = "//*[empty(*) and xxf:is-blank(.)]",
value = "'N/A'",
all = "true"

For more on the `xf:setvalue()` action, see the link below. Would something
like this works for you?

Alessandro Vernet

Dec 21, 2020, 9:07:42 PM12/21/20
Hi Dylan, did you get a chance to look into using `xf:setvalue()` in your
process, to have value of any field left empty to become "N/A"? If so,
you'll let me know if it worked.
Reply all
Reply to author
0 new messages