How to pass a value from Sling Model to AEM Dialog ?
I need to pass a value from my Sling Model, for example shopId to my clientlib js associated with the AEM dialog. Following is my clientlib js for aem dialog.

I need to pass a value from my Sling Model, for example shopId to my clientlib js associated with the AEM dialog. Following is my clientlib js for aem dialog.

Hi @touseefk2181136 ,
You may use ajax call /content/data/shops.infinity.json as suggested by @h_kataria OR you may use below approach.
From front-end just pass shopName and shopAddress only in shopData object to Servlet always.
Then in servlet itself first check if that shop name exist by fetching(making http call to /content/data/shops.infinity.json) all shop data then filter to check shop Id present OR you may use queryBuilder to search for shopId with shopName.
If shopId present you can append else generate the shopId
Thanks
Hi @touseefk2181136 PFA,
You may easily extract the shop id from path(string operation- split) of search result. Even we can use shopName as well shopAddress to check if present by grouping property in query.


path=/content/data/shop
property=shopName
property.value=name2
OR
path=/content/data/shop
group.1_property=shopName
group.1_property.value=name2
group.2_property=shopAddress
group.2_property.value=address2
p.limit=-1
OR if you want only if shop node has id node as a child or not and that unique id if present then we can use simple query as below

Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.