Access composite value in Code Studio - Fragmant Validator

Hi,

I added a composite field in a page in Build Studio. My requirement is to access the composite value in fragment validator, but it is giving me undefined.

const values = fragment_presenter.get_values();

cs.log(JSON.stringify(values)); has the composite reference and its value
“:CMP0001050DADED1”:“93999.0000000000”,

But when I try values[cs.ref(‘RestLimitCmp’)], it is giving undefined.

Any guidance on how to access the composite value in code studio will be helpful.

Hi Priya,

From memory the reference resolves without the colon prefix so changing your code to the following should work:

values[':' + cs.ref(‘RestLimitCmp’)]

Carl

Thanks Carl. It worked perfectly!!!