How to clear profile script local variable | Community
Skip to main content
kirill_techZone
Level 2
November 7, 2024
Solved

How to clear profile script local variable

  • November 7, 2024
  • 2 replies
  • 622 views

Hello.
I have a profile script where I create a local variable using 
user.setLocal('name', 'value');
Is it possible to remove this varialbe as if it was never created before instead of using this approach ?:
user.setLocal('name', undefined);

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kandersen-1

@kirill_techzone AFAIK it isn't possible to remove/delete it. The alternative is as @gokul_agiwal is to set it with an empty string or set a 'null' value.

2 replies

Gokul_Agiwal
Community Advisor
Community Advisor
November 7, 2024

HI @kirill_techzone 

Could you elaborate more on the scenario why you want to remove this variable? 

Have you tried with empty string like user.setLocal('name', ' ');

kandersen-1
Community Advisor
kandersen-1Community AdvisorAccepted solution
Community Advisor
November 7, 2024

@kirill_techzone AFAIK it isn't possible to remove/delete it. The alternative is as @gokul_agiwal is to set it with an empty string or set a 'null' value.

Test forum signature