Behavior: MethodElement

The MethodElement behavior triggers a http Request when an element is rendered.

Developer Use Case

An ImportForm might rely on data from a 3rd party, such as Fiserv.

Such data would typically be collected by creating a custom method, perhaps: Loan.ashx/Fiserv?ID={LoanID}

Using MethodElement, QBO can query a 3rd party when a form element is rendered:
<div id="Question1" data-behavior="MethodElement" data-methodelement-options="{{'className': 'Loan', 'operation': 'Fiserv', 'parameters': 'ID={{LoanID}}"/>

Power User Use Case

MethodElement can be leveraged as an ImportFormQuestion.

Let's say that you want to use 3rd party data in the context of an ImportForm (Task).

You can create a Question that collects data from a 3rd party source, such as Fiserv.

Under the Questions tab on an ImportForm template, create a new Question of the 'MethodSignature' type:

After selecting the 'MethodSignature' option, you need to provide the following information:
  • Class: the module that encapsulates the 3rd party data query, in this case 'Loan'
  • Operation: the name of the Method that collects 3rd party data, in this case 'Fiserv'
  • Parameters: search criteria as accepted by the 3rd party data source, in JSON format.
    • In this case, we are searching by 'LoanID', and collecting the LoanID from the 'ObjectID' hidden input, which is natively populated by QBO.
    • If you wish to reference data that isn't rendered hidden inputs by QBO, you need to create additional Hidden questions, and map Summary data to those questions.
Once this question has collected data, you can store and display the 3rd party data using another dependent question:

  • Use the MappedValue field to reference a data point from the FiservData question