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

[AEM Gems Webinar] Accelerating Experience Manager as a Cloud Service development with Rapid Development Environments

Help constructing SOM Expression


Not applicable

I've puzzled over this for many hours and decided I definitely am a fish out of whater. Could you please help?

My problem: I need a way to substitue a string for the SOM Expression of certain fields without always having to write out the whole expression. Basically, I am trying to figure out if I know the location, can I pass a variable with that location's string into a function, and then have the function process several instructions, using the passed string as the SOM Expression?

For example, if the SOM Expression for 2 fields are:



If I know the string which is the exact location of FieldA and FieldB, can I somehow pass those strings into a script object so the same function can work with multiple fields. E.g. if I wanted to change the font size, bold the font, and font color of each field, could I pass the string of the SOM Expression into a script object method which would process these 3 properties, and then pass the string for the second field's location into the same function to process that field? The reason I want to do this is my form has about 50 such fields which have about 15 processes which are used for each form.

I'm sorry if this isn't clear. I'd really appreciate any help someone might have to offer.


2 Replies


Level 10
You can pass the object itself by using the somExpression. You do not need to pass a string in. So calling the script would be:


and in ths script object to recieve the object you would use:

var myObj = Form1.Subform1.FieldA.nodes

Or you can pass subform nodes and search the subform for fields. if you post your email I will send you a sample that shows how.


Not applicable

Thank you very much for helping me. I'll give it a try.

I would appreciate a sample. My email address is minus the letters "AAA".

Again, thank you.