can a form take logged in user info from the sharepoint?

  • Profile Image
    zehrabatool
    Asked on January 31, 2018 at 05:31 AM

    i want to ask that i created a form on jotform and paste the script on SharePoint portal. so i just want to ask that can my form take logged in user info from SharePoint or not ?

    i have tried a work around to achieve my target, but i failed to do so.

    i downloaded html of my form, then i have create my own script (i.e. 

    if(_spPageContextInfo)

                                                    {

                                                                alert(_spPageContextInfo.userEmail);

                                                    }

                                        }); 

    ) and paste on html file. then i have uploaded it on filezilla, copy the URL of it and import that URL in my jotform then i copy the iframe of my jotform and embeded on SharePoint.

    but i failed to obtain by target.

    do you have any other suggestion on how to perform the same?

    waiting for your prompt response.

    Thanks.

  • Profile Image
    Adrian
    Answered on January 31, 2018 at 09:18 AM

    Do you want to get the email of the logged in account on SharePoint and pass it to the form?

    You can pass data to the form with URL parameters. So, if you want to prepopulate the email field in your form, the URL looks like this:

    https://cdn.jotfor.ms/80302526819455&email=test@email.com


    Help Article: Prepopulating Fields to Your JotForm via URL Parameters


    This would work even when the form is embedded in an iframe.

    I suggest you get the email from SharePoint and make a button that redirects the user to the form with the email parameter in the URL.

    It is not really clear what you want to achieve. If you want something else please let us know


    Thank you.