Widget Init Params not working in ZC Mobile App

Widget Init Params not working in ZC Mobile App

Hi,

I am trying to fetch the Logged In User and show it in a field.
I have attached the screenshots for both the mobile app and Web View.

As you can see in the web view I am able to see the logged-in user email id but in the mobile app, its showing undefined.

Attaching the code as well.

Code -
  1. <!DOCTYPE html>
    <html>
    <script src="js/jScript.js"></script>
    <script src="js/widgetsdk.js"></script>

    <script>
      function loggedInUser(){
        ZOHO.CREATOR.init()
            .then(function(data) {
              //Code goes here
              var initparams = ZOHO.CREATOR.UTIL.getInitParams();
              document.getElementById("loggedInUser").value = initparams['loginUser'];
              alert(initparams);
            });
      }

      function checkuserExists(){
        userEmail = document.getElementById("loggedInUser").value;
        userEmpCode = document.getElementById("empCode").value;
        config = {
          appName:"test",
          reportName:"Logged_IN_User_Report",
          criteria : "(Email == \""+userEmail+"\" && Employee_Code = \""+userEmpCode+"\")",
        }
        ZOHO.CREATOR.API.getAllRecords(config).then(function(response){
          var recordArr = response.data;
          alert(recordArr);
        });
      }

    </script>

    <head>
      <meta charset="UTF-8">
    </head>

    <body onload=loggedInUser()>
      <div class="screen-1">
        <img src="./images/gardeniaLogo.png">
        <div class="email">
          <label for="email">Logged In User</label>
          <div class="sec-2">
            <input type="email" name="email" id="loggedInUser" placeholder="Username@gmail.com" disabled/>
          </div>
        </div>
        <div class="empCode">
          <label for="empCode">Employee Code</label>
          <div class="sec-2">
            <input type="text" name="empCode" id="empCode" placeholder="GC1001"/>
          </div>
        </div>
        <button class="login" onclick=checkuserExists()>Login </button>
      </div>
    </body>

    </html>

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now