Get Username using JavaScript on Form

I am Trying to get first and last name on a form of the user logged in but im unable to do it I can only get user ID using the following JS code

Please help

<!DOCTYPE html>
<html>
<body>

<p>Hello</p>

<p id="test"></p>

<script>
var myInnovator = new top.Innovator();

var userID = myInnovator.getUserID();

document.getElementById("test").innerHTML = userID ;
</script>

</body>
</html>

Parents
  • Hi Haider

    Try below code

    <!DOCTYPE html>
    <html>
    <body>
    <p>Hello</p>
    <p id="test"></p>
    <script>
    var myInnovator = new top.Innovator();
    var userID = myInnovator.getUserID();
    var userDetails = myInnovator.newItem("User", "get");
    userDetails.setAttribute("select","keyed_name");
    userDetails.setID(userID);
    userDetails = userDetails.apply();
    document.getElementById("test").innerHTML = userDetails.getProperty("keyed_name",""); ;
    </script>
    </body>
    </html>

    Thanks

    Gopikrishnan R

  • Thanks a lot for your help!

Reply Children