Conditional Expression Question - InfoPath Dev
in

InfoPath Dev

Conditional Expression Question

Last post 03-25-2009 09:34 AM by zxkuqyb. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-25-2009 08:59 AM

    • zxkuqyb
    • Not Ranked
      Male
    • Joined on 01-14-2009
    • Indianapolis, IN
    • Posts 18

    Conditional Expression Question

    I'm hoping someone can help me on something that I'm struggling with regarding how I would do the following:

    1.  Evaluate a field called "BrandManager" that sits on a repeating table (The BrandManager names will vary across the repeating rows)...

    2.  Compare the previous "BrandManager" field to the "Current_User" field (A Non-Repeating Field on the form and is the User who has opened the form which I set using the GetUserProfileByName Web Service)...

    3.  Disable a Radio Button on the Repeating Row where the "BrandManager" field on that specific row DOES NOT EQUAL the "Current_User"...

    The examples on this site are awesome and there's so many talented people out here, I'm thinking someone might have some insight. 

    When I take and modify one of the examples I found:

                   not(/my:Fields/my:BMApproval_Section/my:BMDetail_Group/my:BrandManager[. = /my:Fields/my:Misc/my:Current_User]) 

    It appears as if it doesn't discriminate accross each Repating Row, rather, the entire table.  How would I alter the above statement to evaluate the "BrandManager" against the "CurrentUser" to hide the Radio Button Control if they don't equal each other?

    Many Thanks!!!

     Tom Barrett

    Thomas N. Barrett
  • 03-25-2009 09:09 AM In reply to

    Re: Conditional Expression Question

    I think you want something more like:

    not(my:BrandManager = /my:myFields/my:Misc/my:Current_User)

    or perhaps

    not(../my:BrandManager = /my:myFields/my:Misc/my:Current_User)

    If you want to actually hide the radio button as opposed to disabling it, you can place it inside a small Section control bound to the same node as the radio button or the repeating group.

     

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 03-25-2009 09:34 AM In reply to

    • zxkuqyb
    • Not Ranked
      Male
    • Joined on 01-14-2009
    • Indianapolis, IN
    • Posts 18

    Re: Conditional Expression Question

    With a slight adjustment to your Expression Statement by removing the /my: at the beginning, it worked...so I thought.

    What seems to be happening is that if my Name is in the "BrandManager" Field on the FIRST row of the repeating table, the Conditional Expression that's tied to the Radio Button for that Row seems to be applying the control to the entire repeating table.  So, it appeared to work, when I tested it.  However, once a different user opened the form and their name was on Row 2 in the "BrandManager" Field, they were not able to interact with the Radio Button on THEIR Row (Row #2), even though their name was in the "Current_User" Field (This field is updated each time during the 'On Open" event.  Each row on the repeating table should be evaluating the "Current_User" Field to each Repeating Row Uniquely, and it doesn't appear to be happening with the Conditional Expression below.  Thoughts?

    Expression Statement:  not(my:BrandManager = /my:Fields/my:Misc/my:Current_User)

    Thank You,

    Tom

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