lua script to get username?

Hello - has anyone created a Lua script to capture the username that is logged into the app and then include that username in a IF statement?

I thought it would be something along the lines of:

local UID = propertystore:getValue('username')

if UID == "apacelli" then
button1:setVisible(true)
end

but that doesnt seem to work. Has anyone done something similiar?


Thanks!

Have more questions? Submit a request

3 Comments

  • 0
    Avatar
    apacelli

    just checking in... has anyone worked on something similar to this?

    Thanks

  • 0
    Avatar
    apacelli

    Figured this out... propertystore example giving in the documentation doesn't seem to work. The way we got this to work is by using:

    local myUserID = getUserID()  

    This is case sensitive... documentation mentions getUserid which returns nil.

  • 0
    Avatar
    smilliken

    Hi Adam,

    I recently created an enhancement request to fix this in our next release of our Dev-guide to help avoid any confusion going forward. Glad to see you were able to resolve this.

    -Scott

Please sign in to leave a comment.
Powered by Zendesk