Submit Button Dynamic Email Address from Database - InfoPath Dev
in

InfoPath Dev

Submit Button Dynamic Email Address from Database

Last post 07-26-2016 05:07 AM by rob_ford16. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 07-21-2016 04:25 AM

    Submit Button Dynamic Email Address from Database

    Good morning all! I am trying to get a submit button to email to a certain person in a database that has a certain position title. I've attached a screenshot of the button properties. The thinking is that I could just manage the database to have the form change when new people come into certain positions. We have many different forms right now and when someone leaves a position in the organization, we have to manually go through each form and update the submit buttons as the emails are hardcoded and not dynamic. The issue is that I keep getting the following error when I preview and click the submit button: One of the required values for submitting the form is missing. The value is created using the following XPath expression: dfs:dataFields/d:Sheet1/@E-MAIL[../@DESIGNATION = "RANK1"] Thanks for any and all help!
  • 07-21-2016 08:07 AM In reply to

    Re: Submit Button Dynamic Email Address from Database

    So - is this form based on a database? That is - is the email field in the main data source or a secondary data source? From your screenshots, it looks like the main data source. :) It sounds from the error message like your formula is not always returning a value. You can put (temporarily) a calculated value on your form where you use the same formula to see if you have any data in the field. I'm guessing unless the form is querying for all the records in your table on load, you may not have a value, and may need to add a query data connection to your form to get back the email address you need. Does that all make sense?
    Hilary Stoupa

  • 07-22-2016 05:08 AM In reply to

    Re: Submit Button Dynamic Email Address from Database

    Hi Hilary! Yes this form is based on a database. Why would the query try to return more than one value? If you look at the screenshot in the first post, I have tried to filter the data to only return @EMAIL when @DESIGNATION = 'RANK1'. Is this incorrect? I have attached another screenshot of how I am filtering the data. Thank you for your help!
  • 07-25-2016 09:40 AM In reply to

    Re: Submit Button Dynamic Email Address from Database

    Anybody have some ideas?
  • 07-25-2016 09:59 AM In reply to

    Re: Submit Button Dynamic Email Address from Database

    Sorry, I meant to get back to you. What I was trying to tell you is that the field you are using for the "to" value may not have a value at the time you send the email. Can you drag your data fields onto the form from the main data source and verify that at least one row has a designation of Rank1 at the time you execute the submit connection?
    Hilary Stoupa

  • 07-25-2016 10:44 AM In reply to

    Re: Submit Button Dynamic Email Address from Database

    Thanks again! As you guessed, no values are being returned. I added a dropdown box and it returns nothing. I checked the Access database to verify there are indeed values in this field, and there are. I've also attached a screenshot of what my drop down box properties were if that helps. The field is formatted as a Text field in the Access database and is showing as simpleType in Infopath. Would that have anything to do with it? Thank you for being patient with me as I am relatively new to Infopath!
  • 07-25-2016 10:59 AM In reply to

    Re: Submit Button Dynamic Email Address from Database

    So - here is what I think. I think you have data in your DB where Designation has the value you are looking for - but that data is NOT in the main data source for your form. I think you need to add another data connection to your form to get this information. How many rows do you think are in your DB where designation is equal to the value you need?
    Hilary Stoupa

  • 07-25-2016 11:37 AM In reply to

    Re: Submit Button Dynamic Email Address from Database

    Thank you! You helped me solve it. I went to the "Data" tab, then "From Other Sources", then "From database". The data connection wizard then opened. I then followed the steps outlined in my attached screenshot. I told it to store a copy of the data in the form template because my database table is small enough. I then told it to automatically retrieve data when form is opened. I also tried the above steps but told it not to store a copy of the data and the problem still persisted. So it looks like there is some connection issue? For now it seems to have been solved.
  • 07-25-2016 11:52 AM In reply to

    Re: Submit Button Dynamic Email Address from Database

    Well - one thing you should know about that option is that the cached data will persist.... is this data that changes often? It does seem like you may have a connection issue if you don't get any data without caching, for what that's worth.
    Hilary Stoupa

  • 07-26-2016 05:07 AM In reply to

    Re: Submit Button Dynamic Email Address from Database

    This data may change often yes. Also, I noticed that the drop down box works now, but I still get the same error if I follow my original methodology for the submit button.
Page 1 of 1 (10 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.