Select to view content in your preferred language

GetUser() Arcade not working

313
1
11-29-2023 12:07 PM
AlcoGISUser
New Contributor III

Trying to calculate field in Smart Form/Field Maps with Arcade calculated expression to populate a field with the current user if another field has been populated.

 

var inspected = $feature.INSPECTION_STATUS;
var userInfo = GetUser();

IIF(IsEmpty(inspected) == 'False', userInfo.username, '');
 
Thought this should do it but entering a value into 'inspected' returns nothing.
Tags (1)
0 Kudos
1 Reply
KenBuja
MVP Esteemed Contributor

IsEmpty returns a boolean, but you're comparing it to the string "False". This will always return False. Use this instead

var inspected = $feature.INSPECTION_STATUS;
var userInfo = GetUser();

IIF(!IsEmpty(inspected), userInfo.username, '');

 

0 Kudos