Updating specific items in Repeating Group - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Updating specific items in Repeating Group

Last post 09-20-2016 05:18 AM by neeenz. 13 replies.
Page 1 of 1 (14 items)
Sort Posts: Previous Next
  • 08-17-2016 11:24 AM

    Updating specific items in Repeating Group

    Hey guys,

     I was reading up Hilary's blog about Hack manifest xsf to filter the target of a rule. I'm trying to update a group inside a group, I've managed to change xsf to reflect what was needed below

    www.infopathdev.com/blogs/Hilary/archive/2009/06/07/hack-manifest-xsf-to-filter-the-target-of-a-rule.aspx 

    myfields >OrgChart>Manager is the group, I'm trying to update a field inside the Manager group called Manager_ but only update where the Employee in the same group is equal to tDReport which is defined somewhere else.

     Below is my .xsf section, I'm starting to think the xpath is incorrect? But when I go to the Rules, it shows Manager_[Employee=tDReport] already which I assume is correct.

    <xsf:assignmentAction targetField="../my:OrgChart/my:Manager/my:Manager_[../my:OrgChart/my:Manager/my:Employee=../my:temp/my:tDReport]" expression="my:tEmp"></xsf:assignmentAction> 

     

    Hilary or anyone have any insights? :)  Much appreciated

    "Be humble for you are made of Earth. Be noble for you are made of stars" - Serbian Proverb
  • 08-17-2016 11:47 AM In reply to

    Re: Updating specific items in Repeating Group

    So - are you saying that it shows the resolved XPath? That should be correct. Is it not working as anticipated? Oh, Manager group repeats? What is the full XPath to the tDReport field?
    Hilary Stoupa

  • 08-17-2016 11:54 AM In reply to

    Re: Updating specific items in Repeating Group

     I think the tDReport path could be flawed, the tDReport is in another group. Yes, the Manager group repeats as well

    myfields>temp>tDReport , but in the .xsf I've used .../my:temp/my:tDReport

    Would that be it? 

    "Be humble for you are made of Earth. Be noble for you are made of stars" - Serbian Proverb
  • 08-17-2016 12:01 PM In reply to

    Re: Updating specific items in Repeating Group

    So maybe ../my:OrgChart/my:Manager[my:Employee=../my:temp/my:tDReport]/my:Manager_
    Hilary Stoupa

  • 08-17-2016 10:10 PM In reply to

    Re: Updating specific items in Repeating Group

     Ahhh that didn't work :( It seems at the Rules side, it does not Update anything. Been inspecting it for a while, manager remains the same. :(

    "Be humble for you are made of Earth. Be noble for you are made of stars" - Serbian Proverb
  • 08-18-2016 12:00 AM In reply to

    Re: Updating specific items in Repeating Group

     I played around with it Hilary, I switched into comparing a different field where instead of Employee = tDReport, I used EmployeeNumber = '123456' and it did update the correct repeating item. Should I have a concat within the original line and add ' to it?

    Current line:

    <xsf:assignmentAction targetField="../my:OrgChart/my:Manager/my:Manager_[../my:Employee =../my:tDReport ]" expression="../my:UpdateMgr"></xsf:assignmentAction>

     

    "Be humble for you are made of Earth. Be noble for you are made of stars" - Serbian Proverb
  • 08-18-2016 08:41 AM In reply to

    Re: Updating specific items in Repeating Group

    Can you attach your form in a reply under the options tab? I think the XPath in the target field is still incorrect for tdReport.
    Hilary Stoupa

  • 08-18-2016 06:49 PM In reply to

    Re: Updating specific items in Repeating Group

     Hi Hilary,

    I attached the actual manifest, the file is too big. Will this open up and u can create a version of the form?  

    "Be humble for you are made of Earth. Be noble for you are made of stars" - Serbian Proverb
  • 08-19-2016 08:14 AM In reply to

    Re: Updating specific items in Repeating Group

    Nope, just the manifest is not enough. Maybe put the template on dropbox or something?
    Hilary Stoupa

  • 08-19-2016 09:24 AM In reply to

    • scyph
    • Not Ranked
    • Joined on 08-12-2016
    • Posts 3

    Re: Updating specific items in Repeating Group

    Hi neeenz,

    You have "../my:tDReport" in your expression. This says that the tDReport field is /my:myfields/my:OrgChart/my:Manager/tDReport which is incorrect as per the information you provide. You should try using /my:myfields/my:temp/my:tDReport instead (or whatever the actual path is).

    So it would be:

    <xsf:assignmentAction targetField="../my:OrgChart/my:Manager/my:Manager_[../my:Employee =/my:myfields/my:temp/my:tDReport ]" expression="../my:UpdateMgr"></xsf:assignmentAction>

  • 08-19-2016 01:55 PM In reply to

    Re: Updating specific items in Repeating Group

    Thanks for the file. This works: targetField="../my:OrgChart/my:Manager[my:Employee = ../../my:temp/my:tDReport]/my:Manager_"
    Hilary Stoupa

  • 08-22-2016 07:52 AM In reply to

    Re: Updating specific items in Repeating Group

     Sorry for the late reply Hilary! That worked so well!!! Can't believe placements matter, can't thank you enough as I've been trying out everything to solve this ;) Thanks again Hilary

    "Be humble for you are made of Earth. Be noble for you are made of stars" - Serbian Proverb
  • 09-16-2016 07:09 AM In reply to

    Re: Updating specific items in Repeating Group

     Hi Hilary,

     How are you? Needed to tweak the condition for this one, but it seems it's not triggering it properly. Am I setting the True section wrong? So before, Employee has to match tDReport, now I only need to update repeating items that have Selected = true, what did I do wrong here? :)

    ../my:OrgChart/my:Manager[my:Selected = true()]/my:Manager_ 

     

    Thank you

     

    "Be humble for you are made of Earth. Be noble for you are made of stars" - Serbian Proverb
  • 09-20-2016 05:18 AM In reply to

    Re: Updating specific items in Repeating Group

     Hey everyone,

     Figured this out, ../my:OrgChart/my:Manager[my:Selected = true()]/my:Manager_ 

    true() should be replaced by string(true()), which turns the expression targetField="../my:OrgChart/my:Manager[my:Selected = string(true())]/my:Manager_"

    Hope this helps ;) 

    "Be humble for you are made of Earth. Be noble for you are made of stars" - Serbian Proverb
Page 1 of 1 (14 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.