Custom Functions - Global variable misbehave with __

Hello Team,
I’m trying to create an agent for our next workshop @ MindStudio.
I have a strange behavior with Global / User variables when using Custom Functions
spent hours to solve still I get inconsistency.

sometimes the function saves it properly to {{global.allICPRows}} & {{user.icpLeadsProfile}}
and sometimes to outputVarName: “__internal__user__icpLeadsProfile”, Saving value of oversized variable {{__internal__user__icpLeadsProfile}}.

Can you please advise me , tried many variations , still get inconsistency.
Thanks,
Shay Bar

Hi @Shay,

Thanks for the post!

Could you share the debugger log links for both runs so we can take a closer look?

In the meantime, consider saving the Custom Function output to a separate variable, then add a Display Content block to write those values into the user variable:

Hey @Alex_MindStudio ,Thanks for helping out.
here are some logs for your inspection:

https://app.mindstudio.ai/share/debugger/e1a332ca-ae1a-4d6b-b2ae-500e25f8ad62/f904248f-437d-41af-ae55-f1178dafb227

https://app.mindstudio.ai/share/debugger/e1a332ca-ae1a-4d6b-b2ae-500e25f8ad62/be0f2767-1a30-4da4-97c7-2229ebdf4cec

https://app.mindstudio.ai/share/debugger/e1a332ca-ae1a-4d6b-b2ae-500e25f8ad62/9e9ac623-e47c-4f44-bd27-a9fe99e05394

I Use currently normal variables , still in order to save the information to later runs , I Need Global or User variables, did try your idea with Display text to Global variable - had the same experience.
Cheers,
Shay Bar

This should be fixed now - small glitch in the variable replacement system. Can you please confirm it’s resolved?

Thanks Sean,
It looks better, but still have issues with the log

https://app.mindstudio.ai/share/debugger/e1a332ca-ae1a-4d6b-b2ae-500e25f8ad62/3a37028a-b77c-4bb1-8f06-21fac8254016

now it saves and bring from global variable , but in the log it writes [object object]
can share the function if you like

Hi @Shay,

Please reference the variable using a JSON prefix, so it’s converted into a string: {{json YourVarName}}

Let me know how it goes!

Hi @Alex_MindStudio

https://app.mindstudio.ai/share/debugger/e1a332ca-ae1a-4d6b-b2ae-500e25f8ad62/139f27da-66c3-427c-80d6-51cb3054203b

Same problem, am I missing something?
Thanks

Hi @Shay,

Could you share a remix link to the Agent and add any mock data so I can attempt to reproduce the issue on our end?

Sure @Alex_MindStudio
How do I share mock date from the agent?
Here is the remix link for this agent:

https://app.mindstudio.ai/agents/smart-follow-dafd4354/remix

Thanks