How to 'else' conditional format a field - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

How to 'else' conditional format a field

Last post 09-14-2018 02:19 AM by maxmum. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-31-2018 08:20 AM

    • maxmum
    • Not Ranked
    • Joined on 07-31-2018
    • Posts 9

    How to 'else' conditional format a field

    Hi There,

    I am a complete novice at InfoPath and have inherited a form with no instructions on how it was written or set up or works etc and am desperately looking for help and walkthroughs and useful information as I am not receiving any on the job training :(

    I have an InfoPath form that  sends requests to a department - who then triage and send notifications back and forth via workflow etc.

    However - the users then asked for a 'required by' date field. So I added one for them. Then they came back and said 'no it needs to not let them submit the form unless the 'required by' date is within 10 days'. so I set up a formatting rule on the field to do this:

    Required By Date is less than or equal to addDays(today(), 10)

    It worked and did what they required.

    However now they have come back because when the form is triaged at a later date - the rule runs again and the person triaging the request has to update the 'Required by' field to 10 days after the date they are triaging! 

     What a nightmare. So they are asking now for something akin to the following, however I have no idea how to write this in 'InfoPath conditional formatting' and am hoping someone can help!

    With my current knowledge this is all I can come up with and it obviously throws an error because I have no idea how to write the syntax correctly:

    Required by date is equal to or less than addDays(today(), 10, else if  â€˜ItemID’ = 'blank' then 'RequiredBy' date addDays(Createdby(), 10)

    Very confusing - but if the item has no ID then it is a new form and should just check if the required by date is 10 or more days in the future. If the ItemID field has been populated already (ie the form is being edited) then set the 'Required By' field to the 'Created' date + 10days

    Thanks in advance for anyone taking the time to think this through I am finding it really hard to get my head around.

     

     

     

     

     

     

  • 07-31-2018 08:53 AM In reply to

    Re: How to 'else' conditional format a field

    I think you may be talking about a validation rule, not a formatting rule - feel free to attach a copy of your form template under a reply on the Options tab if you wish. I'd probably use two validation rules for simplicity. The first would have two conditions, that Created is blank and Required by date is less than or equal to addDays(today(), 10). Then the second rule would be Created is not blank, and Required by date is less than or equal to addDays(Created, 10). Does that make sense?
    Hilary Stoupa

  • 08-01-2018 02:28 AM In reply to

    • maxmum
    • Not Ranked
    • Joined on 07-31-2018
    • Posts 9

    Re: How to 'else' conditional format a field

     Hi Hilary,

     

    Oh thank you so much for getting back to me - I will try this out now and let you know how it goes.

     

    Kind regards 

  • 09-14-2018 02:19 AM In reply to

    • maxmum
    • Not Ranked
    • Joined on 07-31-2018
    • Posts 9

    Re: How to 'else' conditional format a field

     

    Hilary - I'm so sorry I forgot to feed back - this worked a charm thank you so much :)
Page 1 of 1 (4 items)
Copyright © 2003-2018 Qdabra Software. All rights reserved.
View our Terms of Use.