Conditional message when external data source not available. - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Conditional message when external data source not available.

Last post 10-06-2009 10:14 AM by SamCamblin. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-06-2009 07:03 AM

    Conditional message when external data source not available.

    Hi!

    I'm using lookup values from an external data source.  However when the form opens and the user doesn't have access to the internet the dropdown is blank.  I'd like to put a conditional message next to the field to explain why the field is blank.  I'm trying to do it on the attached form but can't get it to work.  Please help.

    Thanks.

    Sam

  • 10-06-2009 09:24 AM In reply to

    Re: Conditional message when external data source not available.

    Hi Sam and welcome,

    What you basically have to do is make a Conditional Formatting rule that counts the number of rows in your retrieved datasource. If the rows are more than 0 (zero) then you hide the error message. I have implemented your requirement in the IP form and reattached it with my post.

    There are a couple of things I changed.

    First of all, it's better to put your message in an expression box control this will allow the text to be rendered as plain text instead of having borders around it.

    Next, you need to add a conditional formatting rule in order to show and hide the message. You can achieve this by following these steps:

    1- Right click on the expression box and go to Conditional Formating...
    2- On the Conditional Formatting dialog box, click on Add...
    3- On the Conditional Format dialog box, under "If this condition is true:", in the fields dropdownlist select "Select a field or group...".
    4- In the Select a Field or Group dialog box, navigate to your secondary datasource. In our case it's "InfoPathTestData (Secondary)".
    5- In the Select a Field or Group dialog box, navigate in the datasource tree and select one of the dataFields for example ":Title"
    6- In the Select a Field or Group dialog box, under the Select dropdownlist, select "Number of occurrences of Title" and press OK
    7- On the Conditional Format dialog box, under "If this condition is true:", in the criteria dropdownfield select "is greater than"
    8- On the Conditional Format dialog box, under "If this condition is true:", in the value dropdownfield select "type a number..." and type 0 (zero).
    9- On the Conditional Format dialog box, under "Then apply this formatting:", check the "Hide this control" checkbox.
    10- Press OK on all dialog boxes
    11- Test your form

    Regards,

  • 10-06-2009 10:14 AM In reply to

    Re: Conditional message when external data source not available.

    Thanks, Samir!  This is exactly what I was looking for.

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