Skip to main content
kirill_techZone
Level 2
Nov 7, 2024 1:51 PM UTC
Solved

How to clear profile script local variable

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.
kandersen-1
kandersen-1Accepted solution
Community Advisor and User Group Leader
Nov 7, 2024 5:15 PM UTC

@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
Nov 7, 2024 3:24 PM UTC

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', ' ');

Translate
Thanks, Gokul
kandersen-1
Community Advisor and User Group Leader
kandersen-1Community Advisor and User Group LeaderAccepted solution
Community Advisor and User Group Leader
Nov 7, 2024 5:15 PM UTC

@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.

Translate