Action rule in repeating table not working correctly - InfoPath Dev
in

InfoPath Dev

Action rule in repeating table not working correctly

Last post 05-04-2017 01:00 AM by bkwhodgson. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 01-23-2017 08:33 AM

    Action rule in repeating table not working correctly

    Hi,

    Using SharePoint 2013, on a browser enabled form that submits to a form library, I have a repeating table with three fields called System, Access Level and Approver.

    I have a SharePoint list on the same subsite which contains a list of Access Levels (single text), System (a lookup to a list called Systems) and their approvers (person picker field) - I am retrieving this list as a data connection.

    Firstly the Access Level field is filtered to only show the access levels that belong to a particular system (i.e. cascading dropdowns) - this works fine. The Access Level field has an action rule which set's the value of the field Approver to the outcome of the following function: substring-after(AccountId[Title = Access Levels], "\"). AccountID is from the Access Levels secondary data connection that's part of the person picker group of the "Approver" column. The filter, although it says "title" when I click further and see the filter, it is filtering based on the Access Level field from the repeating table (part of the "Main" data connection) and the access level field from the secondary data connection to the Access levels SharePoint list.

    The problem is that the first item in the repeating table seems to work OK (at least when it is first entered) as it retrieves the correct approver, but any additional rows don't retrieve the correct approver. Plus, if I edit the first row and change the access level the approver also becomes incorrect.

    I haven't narrowed down any consistency in which approvers are being picked - sometimes it seems to be the user from row 1 that is selected in subsequent rows, but not all the time.

    Can anybody help?

    Thanks. 

    Filed under:
  • 01-23-2017 08:52 AM In reply to

    Re: Action rule in repeating table not working correctly

    Here's a quick sample of what happens / should happen in each row:

    System --- Access Level --- Approver Selected --- Correct Approver

    SysA ----- Level A1 ----------- Andy -------------------- Andy :)

    SysA ----- Level A2 ------------ Andy -------------------- Alex :(

    Sys B ----- Level B1 ----------- Andy --------------------- Barry :(

    SysB ------ Level B2 ------------ Bill ----------------------- Bill :)

    SysA ------ Level A1 ------------ Bill ----------------------- Andy

     

    It seems to be that the repeating table selects the same as the first item / preceding row, until it comes across "Bill", then all future rows are populated with "Bill". The only significance of that that I can think, is in the Access levels table the last entry - the one most recently created (therefore with the highest ID) is the access level with Bill as the approver - it's as if it can't find a match and therefore goes for the access level with the highest ID and selects its approver.

    Hope this helps. 

     

     

  • 01-25-2017 12:35 PM In reply to

    Re: Action rule in repeating table not working correctly

     It sounds like an issue w/ your XPath filter. If you click "Edit XPath" for the formula you are using for the value, what's the full XPath? Just paste it in a reply.

    Hilary Stoupa

  • 01-27-2017 08:50 AM In reply to

    Re: Action rule in repeating table not working correctly

     Here's the XPath for the Action Rule.  

    substring-after(xdXDocument:GetDOM("Retreive Access Levels")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Approvers/pc:Person/pc:AccountId[xdXDocument:get-DOM()/my:myFields/my:Systems_Access/my:System_Access/my:Access_Levels = ../../../d:Title], "\") 

  • 02-06-2017 09:44 PM In reply to

    Re: Action rule in repeating table not working correctly

     I have similar problem. When I apply filter in the repeating table, values that are in top of the secondary list are selected. Not with the highest ID, but by sorting. My secondary data is sorted by country names in ascending order, so if I select Finland, Belgium, then Algeria, all rows are displaying correctly filtered values. But if I select Algeria, Belgium, Finland etc., then all rows get Algeria's values.

     

    Does anyone found solution on this? 

  • 02-07-2017 07:43 AM In reply to

    Re: Action rule in repeating table not working correctly

    Sorry I was so slow to reply, I didn't notice you'd responded till someone else posted in the thread - I think you'll need current here in here someplace - without knowing where the rule is, I'm guessing: substring-after(xdXDocument:GetDOM("Retreive Access Levels")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Approvers/pc:Person/pc:AccountId[current()/../my:Access_Levels = ../../../d:Title], "\")
    Hilary Stoupa

  • 02-07-2017 07:44 AM In reply to

    Re: Action rule in repeating table not working correctly

    Again, you probably need to be using the current() function in your XPath - feel free to attach your form in a reply under the options tab if you'd like me to take a look.
    Hilary Stoupa

  • 05-02-2017 02:34 AM In reply to

    Re: Action rule in repeating table not working correctly

     Hi Hilary, thanks for your response - and apologies for the delay in my response. Unfortunately changing the code exactly as you have written hasn't worked (and I've never edited XPath before so I can't figure it out). I have attached the form template. The code is on an action rule on the Access_Levels field (within the repeating table).

    Thanks for your help, 

  • 05-02-2017 07:20 AM In reply to

    Re: Action rule in repeating table not working correctly

    Try this: substring-after(xdXDocument:GetDOM("Retreive Access Levels")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Approvers/pc:Person/pc:AccountId[current() = ../../../d:Title], "\")
    Hilary Stoupa

  • 05-04-2017 01:00 AM In reply to

    Re: Action rule in repeating table not working correctly

    Thank you Hilary, that has worked perfectly.
Page 1 of 1 (10 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.