getDataValue

getDataValue is used to get the value of a field from the form. This function allows you to retrieve any value from the form or its repeats if they are currently loaded in a field or not.

Syntax

getDataValue(string xpath)

Parameters

xpath

This is an xml xpath statement that equates to a field value in the InfoFile or any of its repeats

Return Value

NA

Remarks

XPath, the XML Path Language, is a query language for selecting nodes from an XML document. In addition, XPath may be used to compute values (e.g., strings, numbers, or Boolean values) from the content of an XML document. XPath was defined by the World Wide Web Consortium (W3C).

 

Example

These Examples are to indicate only, substitute your fields in there place

Gets the value of a field called Spouse_Name_Full_scr

GetDataValue("//Spouse_Name_Full_scr")

 

Gets the value of a Field called Gift_Opt_Def_Benef_Rship_txt from a particular row(n) from a repeat control

GetDataValue("//Gift_Opt_Def_Benef_rpt[" + n.tostring() + "]/Gift_Opt_Def_Benef_Rship_txt")

 

Gets the value of a field called FieldA_yn where the value is equal to true

Dim str as String    

str = GetDataValue("//Repeat_rpt[FieldA_yn='true']/FieldA_yn")

 

Returns true if any child is under 18 years old

GetDataValue("//Child_rpt[Child_Age_num<18]... queries all the "answers" to see if any ages are less than 18

 

Returns True if any gift has a Testamentary Trust

GetDataValue("//Gift_Prim_Spec_rpt[Gift_Prim_Spec_TT_yn='true']... queries the "answers" to see if any Gifts have TT

 

Loops through a Repeat to append a value

For n = 1 to fld.Gift_Opt_Def_Benef_rpt.NodeCount

            If n <> fld.Gift_Opt_Def_Benef_rpt.NodeCount Then

                retval = retval + "my " + GetDataValue("//Gift_Opt_Def_Benef_rpt[" + n.tostring() + "]/Gift_Opt_Def_Benef_Rship_txt") + " " + GetDataValue("//Gift_Opt_Def_Benef_rpt[" + n.tostring() + "]/Gift_Opt_Def_Benef_Name_Full_txt") + ", "

            Else

                retval = retval.TrimEnd(",")

                If fld.Gift_Opt_Def_Benef_rpt.NodeCount > 1 Then

                    retval = retval + "and my " + GetDataValue("//Gift_Opt_Def_Benef_rpt[" + n.tostring() + "]/Gift_Opt_Def_Benef_Rship_txt") + " " + GetDataValue("//Gift_Opt_Def_Benef_rpt[" + n.tostring() + "]/Gift_Opt_Def_Benef_Name_Full_txt")

                End If

            End If

        Next n

powered by metaPost



Created by Bruce in 5/16/2009 5:15:10 PMprint



rating
  Comments

  
Copyright 2009 by Zumesoft Pty Ltd Privacy StatementTerms Of Use
Small width layoutMedium width layoutMaximum width layoutMaximum textMedium textSmall text