web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Jquery is not working on powerapps portal.

(0) ShareShare
ReportReport
Posted on by 5

Hi All,

Issue: in powerapps Portal jquery is not working.(unable to get web role of logged in user)

i am facing issue with jquery, where in a function i want to take the user's current logged in web role.

i have written function which works fine in DEV but doesen't work in SIT environment after deployment.

I have checked all code and related files, web pages, permissions are fine,

Even when i put a debugger; the debugger doesen't show any code after stopping at debugger.

A code in DEV works perfectly fine to get the user's current role the only problem is with SIT

I am still learning portal, so even basic answers also appreciated.

Please find below code which is working perfect in DEV environment.

$(document).ready(function() {
debugger;
// Get Loggedin user name and Loggedin user account name
var user = "{{ user.fullname }}";
var account = "{{ user.parentcustomerid.name }}";

Thanks,

Tejas.

I have the same question (0)
  • Suggested answer
    Inogic Profile Picture
    682 on at

    Hi Tejas,

    Please try the below steps and let us know if it works for you:
     

    1.      Sign-In to portal with the contact, which should have “Administrator” web role associated with him.

     

    2.       Use below code on web page/ entity form:

     
    $(document).ready(function() {
    debugger;
    var customMessage=”Check debugger”;
    alert(customMessage);
    });
     

    3.      Clear cache of portal:

     
    <<Portal URL>>/_services/about
     

    4.      If above code works then you can try below code, after signing to portal:

     
    $(document).ready(function() {
    debugger;
    // Get Loggedin user name and Loggedin user account name
    var user = "{{ user.fullname }}";
    var account = "{{ user.parentcustomerid.name }}";
    });
     

    5.      Clear cache portal:

     
    <<Portal URL>>/_services/about
     

    6.      Refresh the page and check if the code is debugging:

    Hope this helps!
  • Suggested answer
    Akhil101 Profile Picture
    432 on at

    Check if your custom JS is added under Localized content of your web page. Open the record -> go to Advanced -> add your Custom JS there. See if it works!!

    pastedimage1617797538645v1.png

    Regards,

    AKHIL

  • Suggested answer
    Tejas K Profile Picture
    5 on at

    Thanks for your early responses. :)

    This issue has been resolved now.

    Actually on Portal what I have noticed is,

    If contact configuration is not done in correct way then it could cause this issue.

    How I solved:

                         1: Deleted and recreated the contact in Portal Management app.

                         2: Configured my contact with Invitation redemption in various ways and checked the duplicate email has not been created while redeeming invitation code.

                         3: After login validated and it started working fine.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 70

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans