Expand my Community achievements bar.

Join expert-led, customer-led sessions on Adobe Experience Manager Assets on August 20th at our Skill Exchange.

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

Avatar

Level 1

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
5 Replies

Avatar

Level 1

xxxxx.png

Avatar

Level 3

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-func...

Avatar

Moderator

You can create a custom function and invoke it using a rule. The following documentation provides detailed information about custom functions along with examples:

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/forms/adaptive-f... 

Avatar

Level 6

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.

Avatar

Administrator

@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