How to check the current logged in user email in infopath? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

How to check the current logged in user email in infopath?

Last post 11-14-2023 11:06 AM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 11-12-2023 10:40 AM

    How to check the current logged in user email in infopath?

     I have an application of infopath. it has 5 views(pages)

    the last view page has a button to approve or reject.

    the user will are going to approve or reject on this page are known( 2 users).

    I want to make the approve or reject button active if  these users are logged in, but for other user it will be disabled or I want to make the page only accessible for these two users while it will not be accessible for other users.

    can  you suggest any solutions?

  • 11-13-2023 03:52 PM In reply to

    Re: How to check the current logged in user email in infopath?

    So - InfoPath has the userName() function. The data returned will depend on your environment and whether you are using InfoPath Filler or Browser. I'd recommend to start with that you put a calculated value control on your form with the userName() function for its value. You'll be able to see the format for your user names then. You can then add conditional formatting on the approve / reject buttons to disable them except for your two known users. Depending on how users get to the last view, you could also use formatting conditions on the rule that takes users to the last view to only run for your two known approvers.
    Hilary Stoupa

  • 11-13-2023 10:04 PM In reply to

    Re: How to check the current logged in user email in infopath?

    Currently I am working in power apps but maintaining an existing application. is there a way to make specific info path view accessible for some users and for some other users not accessible (when they try to access it , it will show access denied page).

    thanks in advance.

  • 11-14-2023 11:06 AM In reply to

    Re: How to check the current logged in user email in infopath?

    Well, you could try using sections with conditional formatting. So, in one section in the view, put all the stuff you want the "authorized" users to see. In another, put the text "You are not authorized" or something. Then, you could use conditional formatting to show / hide these. For the user who are not supposed to use the view, hide the section with the text. For all other users, hide the section with controls. Sample attached - right click and save locally, then right click and select design. Preview and follow the instructions. For simplicity, I'm using a field for the userName you want to test with but that can be hardcoded instead. Please note that InfoPath is case sensitive. If your userName is JohnDoe, you can't use johndoe - that isn't equivalent. Hope this helps!
    Hilary Stoupa

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.