attachment field - InfoPath Dev
in

InfoPath Dev

attachment field

Last post 09-23-2015 10:44 AM by DDEBBABY. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 09-23-2015 08:27 AM

    attachment field

    I am trying to create a text box that is attached to the attachment field that will count the number of attachments but I cannot get this to work properly.  Can someone take a look what I may be doing wrong
  • 09-23-2015 10:19 AM In reply to

     You are having an issue because this is a list form and attachments are handled differently there - you'll notice the attachments field isn't repeating. If you attach some files in preview and go to File > Save As and look at the XML, you'll see that there is nothing stored in the attachments node.

    The only work around I can come up with is:

    1. Add a query (receive) connection to the same list that the form is for
    2. Set the query to NOT run on load
    3. Include the ID and Attachments in the query. 
    4. As part of your logic that needs to check for the count of attachments, set the ID field in the query fields for the new data connection to the ID from the main data source in your form.
    5. Execute the query
    6. Count the returned repeating attachmentUrl field in the secondary data connection

    Of course - this all only works if your form has an ID in the main DS, which means it has to have been submitted at least once.

    Hilary Stoupa

  • 09-23-2015 10:24 AM In reply to

    wow ok thanks so much I will see if I understand and try this.  Thanks sooo much
  • 09-23-2015 10:35 AM In reply to

    I am confused with step 4. how do you do this?
  • 09-23-2015 10:43 AM In reply to

    The new data connection you added will have query fields and data fields. Add a rule to set the query field for ID in the new data connection to the ID field in your main data source. Then add a rule to run the query.
    Hilary Stoupa

  • 09-23-2015 10:44 AM In reply to

    ok I see thanks so much
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.