Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Adaptive Form - Form Data Model - Get and use value within the rule editor

Avatar

Level 4

Hello,

 

I have the following form data model get service within my submit button. On pressing submit, there is no issue populating the "statusId" field in the output. However, I want to directly store the output value into a variable declared in the submit button, rather than be stored in the "statusId" field. This way, the value will persist in the variable and can be continuously used within the submit button script. I would appreciate any help on this. Thank you

 

 

 

    var operationInfo = {
      "formDataModelId": "/content/dam/formsanddocuments-fdm/x/yy/zzz/test-name",
      "operationTitle": "getStatusID",
      "operationName": "getStatusID"
  };
  var inputs = {
      "SubmissionType" : submissionType,
      "Name" : preparerName,
      "Year" : currentYear
  };
  var outputs = {
      "StatusID" : statusID
  };
  guidelib.dataIntegrationUtils.executeOperation(operationInfo, inputs, outputs, null, null, this);

 

 

For example:

 

var newStatusId;

var operationInfo = {
      "formDataModelId": "/content/dam/formsanddocuments-fdm/x/yy/zzz/test-name",
      "operationTitle": "getStatusID",
      "operationName": "getStatusID"
  };
  var inputs = {
      "SubmissionType" : submissionType,
      "Name" : preparerName,
      "Year" : currentYear
  };
  var outputs = {
      "StatusID" : newStatusId
  };
  guidelib.dataIntegrationUtils.executeOperation(operationInfo, inputs, outputs, null, null, this);

 

 The returned value should be stored in the newStatusId variable

1 Accepted Solution

Avatar

Correct answer by
Level 4
1 Reply

Avatar

Correct answer by
Level 4

I was able to resolve my problem. See Step 3 #6 in the following link:

https://github.com/AdobeDocs/experience-manager-65.en/blob/main/help/forms/using/apply-rules-to-adap...