Having an issue populating an field when INFOPATH Loads. - InfoPath Dev
in

InfoPath Dev

Qdabra® Training

Use our Google Custom Search for best site search results.

Having an issue populating an field when INFOPATH Loads.

Last post 09-10-2018 10:46 AM by Hilary Stoupa. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 08-31-2018 02:18 PM

    • drcoz
    • Not Ranked
    • Joined on 08-28-2018
    • Virginia
    • Posts 5

    Having an issue populating an field when INFOPATH Loads.

    I found this article very useful and was exactly what I was looking for.

    https://social.technet.microsoft.com/wiki/contents/articles/32515.restrict-infopath-section-visibility-based-on-user.aspx

    but, I've tried to expand on this without success.

    I have an access list, based on the above link, that has two columns in it:

    AdminUser
    AccessType

    NOTE:  The above link only had the AdminUser, I added the AccessType which would have data like AccessLevel1; AccessLevel2, etc.

    Again following the instructions in the above article I got this all to work, but when I tried to have the AdminUser AccessType added to a field in the MAIN data field, it won't copy it for the current user. 

    I can do a AccessType = AccessType, but that brings back the first records fom the access list, AccessType not the current users.

    On form load I did try to added an additional Run these actions "Set a Fields value:  Field:  AccessType   Value: AccessType[ID=AccessType]" but does not work either.

    I have put the IsAdmin / CurrentUser / AccessType on the form so I can see what data is being carried over as well.  IsAdmin is a field in the MAIN data that I add to add per the above article link.

    I searched google and I just can't find a resolution, that I can do.  I did find the following, but I don't have access to the http://<Your Web App>/_vti_bin/UserProfileService.asmx; so I can't make this work either.

    https://spvee.wordpress.com/2013/04/10/auto-populate-user-information-in-infopath-with-claims-based-authentication-part-1-of-3/

    Have deleted and recreated the rules several times trying to get this work as well.

    I'm hoping someone has a simple answer.

    Thanks for your time.


    Derek R Cosby
  • 09-05-2018 08:14 AM In reply to

    Re: Having an issue populating an field when INFOPATH Loads.

    Any chance I can see a copy of your form? Can you attach it under the Options tab in a reply?
    Hilary Stoupa

  • 09-06-2018 01:16 PM In reply to

    • drcoz
    • Not Ranked
    • Joined on 08-28-2018
    • Virginia
    • Posts 5

    Re: Having an issue populating an field when INFOPATH Loads.

    Hilary,

     Appreciate the help...I've attached the InfoPath form. 

     

    You'll notice I have four sections:

    1)  Submitted by to be seen by anyone in the  IsAdmin

    2)  Director's Comments - Only to been seen by Director, and after update/submit, can be read by anyone.

    3) Integration Office Comments - Only to be seen by Integration, and after update/submit, can be read by anyone

    4) Action Officer Comments - Only to be seen by Action Officer, and after update/submit, can be read by anyone 

     

    The AccessType field is where the different permissions will need to be used to determine if they are suppose to see 2, 3 or 4 above.

     

    Thanks! 

    Derek R Cosby
  • 09-06-2018 02:34 PM In reply to

    Re: Having an issue populating an field when INFOPATH Loads.

    Is your IsAdmin field getting set correctly when the form opens? I see you are leveraging that field in order to get the Access Type. I've added a few more fields to your form so you can see the value returned by the userName() function, as well as the data returned by your list. Perhaps publish this and take a look at the data to see if anything isn't what you expect. XPath is case sensitive, so if userName() returns Hilary.Stoupa but the Account ID from the Access Type list returns hilary.stoupa we wouldn't have a match. Save the attached file locally, then you can right click and select design to open so you can preview / publish. The userName() function may return something different in preview vs. in the browser (another thing to watch out for!). You may also need to modify your formatting conditions, once you know access type is being set - I kinda think they should be "if IsAdmin is blank OR access type <> whatever the type is for the section" but and / or always make my head a little spinny.
    Hilary Stoupa

  • 09-06-2018 03:50 PM In reply to

    • drcoz
    • Not Ranked
    • Joined on 08-28-2018
    • Virginia
    • Posts 5

    Re: Having an issue populating an field when INFOPATH Loads.

     Yes the IsAdmin and the CurrentUser() to come out and that parts works.  It is just trying to add the accesstype is where I'm getting lost.  I'm at home, so I'll load up the form when I get to work in the morning and then do some screen shots so you can see what I see.

     

    Appreciate the help.

     

    Derek 

    Derek R Cosby
  • 09-07-2018 04:36 AM In reply to

    • drcoz
    • Not Ranked
    • Joined on 08-28-2018
    • Virginia
    • Posts 5

    Re: Having an issue populating an field when INFOPATH Loads.

    WOW!!!   Not sure what you did, but it's now working.  Also I did have to do OR instead of AND in the formatting conditions.  Attached is a screenshot of me logging in as Action Officer, which did only show the action officer block.

    Thanks!

     Derek

     


    Derek R Cosby
  • 09-07-2018 04:37 AM In reply to

    • drcoz
    • Not Ranked
    • Joined on 08-28-2018
    • Virginia
    • Posts 5

    Re: Having an issue populating an field when INFOPATH Loads.

     I couldn't upload both pictures...this one shows me logged in as a normal user.

     

    Again Thanks!

     

    Derek 


    Derek R Cosby
  • 09-10-2018 10:46 AM In reply to

    Re: Having an issue populating an field when INFOPATH Loads.

    Wonderful - glad you have it sorted out. :)
    Hilary Stoupa

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