Eval/Concat with conditions - InfoPath Dev
in

InfoPath Dev

Eval/Concat with conditions

Last post 07-15-2010 09:02 AM by utcwp01. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-14-2010 09:04 AM

    Eval/Concat with conditions

    I am trying to set an approvedBy text field with values of a repeating table field called approvalName.  I was able to do this perfectly with the following formula:

    eval(eval(approval, 'concat(my:approvalName, ", ")'), "..")

     My issue is that there are names in the approvalName repeating table field that are part of the approval process but I do not want them showing up in the approvedBy text field.  I have tried using the formula listed and setting a filter on the approvalName field so it did not display an approval name equal to a certain name.  But each time I get a formula error.  Is there are way "outside of code" to accomplish the pulling of the repeating table field on a conditional basis?

    Filed under: ,
  • 07-14-2010 04:04 PM In reply to

    Re: Eval/Concat with conditions

    I recall having this issue in IP 2007, but just tried in IP 2010, and didn't have an issue. qRules has a command that allows this, if you want to give it a try (as well as a lot of other cool commands).

    Here is the issue, I think -- when you write the formula, no instance of the approval group exist that match the filter condition. Is the default value of approvalName blank? Try adding the filter to approval that approvalName is blank. The formula doesn't error for me in IP 2007 as long as there is a node that matches the condition in the data source. As far as work arounds.... You can add multiple instances of the group to the form and set defaults in the approvalName field for each of the filters you want, but then what will you do when the user opens the form to get rid of the group? There isn't anything built in to InfoPath that will delete an instance of a group.....

    Hilary Stoupa

  • 07-14-2010 04:53 PM In reply to

    Re: Eval/Concat with conditions

    Have you tried putting the filter on the approval field?  Whenever I try a double eval, I put the filter on that part of the formula, and haven't had a problem with it yet.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 07-15-2010 09:02 AM In reply to

    Re: Eval/Concat with conditions

    I was trying to attach some screen shots of the form but it doesn't seem to be working.  So lets see if I can give a little more detail.  I have a repating table (group name approval) that (for what we need in this case) looks like this:

    Routed To: (approvalName)                               Routing Task Type: (routingTaskType)

    User 1                                                             PR Approval

    User 2                                                           Justification Approval

    User 3                                                           PR Approval

     

    From here I have the Approved By text box.  I need the formula to pull the values from that repeating table and place them in the text box.  The formula I put in my initial post works great if you want it to gather all of them.  The issue is that I only want it to pull the ones that have a routingTaskType of "PR Approval".  So for the example above, the text box wouls show User 1, User 3.

    I tried the suggestions of putting the filter on the group and the formula verified, but it did not populate the text field when I tested it. 

    Hopefully this makes a little more sense now.

     

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