Auto-populate Pre-determined Text if field is blank - InfoPath Dev
in

InfoPath Dev

Auto-populate Pre-determined Text if field is blank

Last post 01-02-2017 04:22 PM by Hilary Stoupa. 21 replies.
Page 2 of 2 (22 items) < Previous 1 2
Sort Posts: Previous Next
  • 12-27-2016 09:47 AM In reply to

    Re: Auto-populate Pre-determined Text if field is blank

    Can you clarify where the following should be accomplished..."So put a rule on the ID field to set the date (or whatever) field based on a condition...."? Should the rule be attached to the ID field in the data connection, and should that be an action that set field value of the Date of Last Inspection -if blank- to whatever text I want instead a blank field?
    Filed under:
  • 12-29-2016 05:17 AM In reply to

    Re: Auto-populate Pre-determined Text if field is blank

    Rules fire when a value changes. However, when you query a data source, on the initial query, rules on those fields DON'T fire. Put the rule on wherever the user enters the building number (you call it the "building number entry process" above). I'm assuming that is when you query the secondary data source?
    Hilary Stoupa

  • 01-02-2017 12:56 PM In reply to

    Re: Auto-populate Pre-determined Text if field is blank

     One follow-up; one of the fields impacted is a 'Date Next Due', that is set as a calculated value, date type, date only, field. The text in this field appears in my InfoPath form field as 2018-03-10 00:00:00. I cannot figure out how to get the text to show at date only, formatted as x/xx/xxxx.

    Filed under:
  • 01-02-2017 03:22 PM In reply to

    Re: Auto-populate Pre-determined Text if field is blank

     Can't get this to work.

    There are two data connections; Master Bldg List and Master System Inspection List

    The form, including the repeating table connected to the Master System Inspection List, auto-populates once the Building No. is entered.

    Your original suggestion was to , "repurpose" another field in the secondary data connection - I'm assuming that means the Master System Inspection List connection.

    On the Building No. field Rule 1 queries the Master Bldg List data connection for the Building No.; Rule 2 queries the Master Bldg Connection List for the rest of the form data.

    There is a repeating table that includes several fields from the Master System Inspection List. There is a rule on this table that fires the Master System Inspection Data Connection once a valid Building No. is present.

    The Master System Inspection Building No. must match the Master Bldg List Building No. for data to appear in the repeating table.

    Your instruction was to "... put a rule on the ID field to set the date field based on a condition..." 

    I've attempted to make a Rule on the 'ID' field of the repeating table Master System Inspection Connection with a condition that would make the 'Date of Last Inspection' field "No Reported Submitted", based on the  Master Bldg List data connection

    Your instruction continued with "...on the building number, set ID (after querying the data source) to something it will never normally be, like 0." 

    In Rule 4 of the Master Bldg List data connection I've set the value of the 'ID' field to "0".

    The Date of Last Inspection field in the repeating table still appears blank where no data has been entered into the Master System Inspection List   

     

     

     

    Filed under:
  • 01-02-2017 03:28 PM In reply to

    Re: Auto-populate Pre-determined Text if field is blank

    My instructions are intentionally vague, as I obviously have no details as to the actual structure of your form. Which of your two secondary data connections has the data where you want to reset the field to display "No Report Submitted"? It would probably be way easier to just put a calculated value in the area where you want to see this text and use conditional formatting to determine which you want to show. Attach the template to a reply under options if you need a hand with that.
    Hilary Stoupa

  • 01-02-2017 04:13 PM In reply to

    Re: Auto-populate Pre-determined Text if field is blank

     Understood. I've tried several version of a formula in the field I want to show the date of inspection or No Report Submitted. Last version was, no luck.

    =IF(ISBLANK([Date Previous Inspection])," ",No Report Submitted")) 

    Filed under:
  • 01-02-2017 04:22 PM In reply to

    Re: Auto-populate Pre-determined Text if field is blank

    So this is something you are trying to do in your SharePoint list as a calculated column? InfoPath doesn't have IF or ISBLANK. I'm attaching a simple sample that has two tables bound to the same data source. Save the file locally, preview and in the top instance of the table, enter some data. Leave the data column blank in some rows & enter a date in others. You'll see that I've used conditionally formatted calculated values in the second instance of the table to display either the entered date or some text. Hopefully this will help.

    EDITED TO ADD: Save the linked file locally, right click and select Design to open in design mode. From there you can preview, look at the design, etc. 

    Hilary Stoupa

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