Rule or XPath to Return Result? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Rule or XPath to Return Result?

Last post 07-17-2018 08:30 AM by clutchrider. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 07-11-2018 11:56 AM

    Rule or XPath to Return Result?

    I have a form that is essentially a time sheet. I have set fields to calculate the difference between time (in/out) and provide the result in a field as a decimal (i.e. 8am-1230pm results in the Actual Time field showing 4.5). What I would like to do is expand this to have two additional fields that pull this number apart. The fields are Regular Hours and Overtime. The Regular Hours field should display the Actual Time field entry up to 8 hours and the Overtime field should display any time above 8 hours from Actual Time. I was attempting to be simple and use an Action rule to say if the value in Actual Time is less than or equal to 8 then populate the Regular Hours with that entry. That returns nothing so I started looking for ways to use Xpath to simply return but it looks like having this type of statement is not so easy to calculate/compute. Thanks in advance!
  • 07-12-2018 08:31 AM In reply to

    Re: Rule or XPath to Return Result?

    An action rule should do this. See attached - save the file locally, right click and select design, then preview & try it out. Rules are on field1.
    Hilary Stoupa

  • 07-17-2018 05:41 AM In reply to

    Re: Rule or XPath to Return Result?

    I tried this application but was not successful. Your field1 for me would be a calc field called ActualTime that displays the difference in time in decimal format for total hours entered that day (punch in/out). That field should show the total time regardless, then it should be populating a RegTime field with up to 8 hours and anything over 8 hours into a field called OverTime all based on the ActualTime field.. The end results would show as attached where fields ActualTime, RegularTime, OverTime would all be auto populated based on my scenario. I think we are close though.
  • 07-17-2018 05:52 AM In reply to

    Re: Rule or XPath to Return Result?

    I got it! I just had to play with where the rules were placed and where they were pointing to! Thank you!
  • 07-17-2018 08:28 AM In reply to

    Re: Rule or XPath to Return Result?

    Glad you got it working! One thing that I found hard to remember when I started with InfoPath was where rules go - you want your rules on the field that will be changing. Action rules fire when a field changes, so if you want to set fieldB when fieldA has a certain value, the rule goes on fieldA. :-)
    Hilary Stoupa

  • 07-17-2018 08:30 AM In reply to

    Re: Rule or XPath to Return Result?

    That is a huge help in understanding the logic. Now I just need to figure how to get time to calc across multiple entries. New post coming soon I think.
Page 1 of 1 (6 items)
Copyright © 2003-2018 Qdabra Software. All rights reserved.
View our Terms of Use.