How can I write a function that accepts a dynamic number of parameters in a visual rule editor (instead of fixed arguments)? | Community
Skip to main content
ngọc_duyn633459
New Participant
June 17, 2025

How can I write a function that accepts a dynamic number of parameters in a visual rule editor (instead of fixed arguments)?

  • June 17, 2025
  • 4 replies
  • 618 views

Hi everyone

I'm working with a visual rule editor (as shown in the screenshot attached – possibly AEM Forms or a similar tool) and I'm trying to create a function like setActionField() that can accept a dynamic number of input values, instead of hardcoding a specific number of arguments (like field1, field2, etc.).

Any guidance or examples would be greatly appreciated!


 
Updating Media

4 replies

kautuk_sahni
Employee
June 26, 2025

@ngọc_duyn633459 Just checking in — were you able to resolve your issue?
We’d love to hear how things worked out. If the suggestions above helped, marking a response as correct can guide others with similar questions. And if you found another solution, feel free to share it — your insights could really benefit the community. Thanks again for being part of the conversation!

Kautuk Sahni
New Participant
June 25, 2025

Hi @ngọc_duyn633459 ,
You can try one thing to achieve this, create one text field and set the list of param with the delimiter of :: (or in the form of json) then pass that text field value as a input for your custom method. You can retrieve json and convert as a key value pair / variables as you want.

 

Thanks.

Employee
June 17, 2025

Hello @ngọc_duyn633459 

 

You can refer to doc at [0] for writing the custom functions in AEM Forms and using them through rule editor.

 

Thanks,

Rahul Pandey

 

[0] https://experienceleague.adobe.com/en/docs/experience-manager-learn/forms/adaptive-forms/custom-functions-aem-forms

Khushwant_Singh
Employee
June 18, 2025
ngọc_duyn633459
New Participant
June 17, 2025