Service dialog - dynamic field - shared value?

Hi, I have complex service dialog which has several dynamic dropdown based on current user AD group membership.
In each dropdown I perform call to LDAP to return all current user’s groups (several levels).

I would like to make the LDAP search just once and use the results in several dynamic fields for father processing …

Is there any way to do that?
Thanks

Its not neat solution but simple. You can register ldapsearch output locally or in one of the dialog fields and make references in rest of dialog fields which need those information

Sebu1’s answer should work just fine, however I am going to post another idea, just in case

If you are only worried about the LDAP servers load or the network in general and you want to share the LDAP results between multiple workflows, you can use the memcache instance on the appliance:

userid = $evm.root['user'].userid
@cache = Dalli::Client.new(nil, namespace: "ldap_cache", expires_in: 5.minutes)
data = @cache.get(userid)
if data.nil?
  data = search_ldap(userid)
  @cache.set(userid, data)
end
1 Like

What do you mean by registering output locally?
The idea with hidden dialog field to store the ldap search output occured to me as well but I was worried about dialog field value max lenght limitation (if there is any at all?) beause user’s AD group list can easily exceed 1000 chars here…

this seems nice, I will definitely try that… Thanks

I would guess sebu1 meant to just set a variable in $evm. I am not 100% sure if dynamic method invokations in the dialog share the same $evm-variable, but I would not be surprised if they do

$evm.root['ldap_result'] = ldap_result

This unfortunately cannot be done, dynamic method don’t share anything (to my knowledge)

the memcache solution works for me, thanks