統合

データ要素の作成

AEM Forms as a Cloud Service

タグプロパティに、2 つの新しいデータ要素(ApplientsStateOfResidence および validationError)を追加しました。

adaptive-form

ApplicantStateOfResidence

ApplicantStateOfResidence データ要素は、以下のスクリーンショットに示すように、拡張子のドロップダウンで「コア」を選択し、データ要素タイプとして「カスタムコード」を選択することで設定されました。
applicant-state-residence

次のカスタムコードは、ステート ​アダプティブフォームフィールドから値を取得するために使用されました。

// use the GuideBridge API to access adaptive form elements
//The state field's SOM expression is used to access the state field
var ApplicantsStateOfResidence = guideBridge.resolveNode("guide[0].guide1[0].guideRootPanel[0].state[0]").value;
_satellite.logger.log("Returning  Applicants State Of Residence is "+ApplicantsStateOfResidence);
return ApplicantsStateOfResidence;

validationError

ValidationError データ要素は、以下のスクリーンショットに示すように、拡張子のドロップダウンで「コア」を選択し、データ要素タイプとして「カスタムコード」を選択することで設定されました。

validation-error

次のカスタムコードは、validationError データ要素の値を設定するために記述されました。

var validationError = "";
// Using GuideBridge API to access adaptive forms fields using the fields SOM expression
var tel = guideBridge.resolveNode("guide[0].guide1[0].guideRootPanel[0].telephone[0]");
var email = guideBridge.resolveNode("guide[0].guide1[0].guideRootPanel[0].email[0]");

_satellite.logger.log("Got tel in Tags custom script "+tel.isValid)
_satellite.logger.log("Got email in Tags custom script "+email.isValid)

if (tel.isValid == false) {
  validationError = "error: telephone number";
  _satellite.logger.log("Validation error is "+ validationError);
}

if (email.isValid == false) {
  validationError = "error: invalid email";
  _satellite.logger.log("Validation error is "+ validationError);
}

return validationError;

次の手順

ルールの作成

recommendation-more-help
4859a77c-7971-4ac9-8f5c-4260823c6f69