Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Is it possible to have parameterized function calls in AEM Use API?

Avatar

Level 6

I have seen parameters being passed to the Use API while invoking the same in HTL.

e.g.

<div data-sly-use.params="${'params.js' @ value1='feike', value2='visser', seperator=' '}">

  ${params.newValue}

</div>

Is it possible to pass parameters to the Use API function call instead of the API invocation itself?

e.g.

<div data-sly-use.params="${params.js}">

       ${params.newValue @ value1='feike', value2='visser', seperator=' '}

       ${params.newValue @ value1='firstname', value2='lastname', seperator=' '}

</div>

That way we can initialize the use api once and call functions with multiple params in code.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

I don't think, it is possible. Though you can get map value by passing keys

like params.newValue['value1']



Arun Patidar

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi,

I don't think, it is possible. Though you can get map value by passing keys

like params.newValue['value1']



Arun Patidar