How do I write a value to a metadata column on form submit? - InfoPath Dev
in

InfoPath Dev

How do I write a value to a metadata column on form submit?

Last post 05-07-2009 11:41 AM by slingeronline. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 04-29-2009 10:18 AM

    How do I write a value to a metadata column on form submit?

    The subject line of this may be a little misleading, but here is the issue I am trying to resolve.  In my form for a sharepoint library, I use the owssvr.dll to get the filename of files to populate a dropdown list.  What I need, is that when the form is submitted, to apply a value from the form (the autonumber value that the form uses for the form name) to every document that was selected in the dropdowns.  So if I select document 1, 2, 3, 4, and 5 from the drop down, and then click submit, I want a metadata value for document 1, 2, 3, 4, and 5 to be automatically populated with a value from the form.  For instance, When I click "New Form" from the form library, the form automatically gets numbered.  The user will use the dropdown list to select the documents that will be listed on the form.  When the user clicks "Submit," the forms autonumber value should be automatically entered into the field for each document that was selected in the dropdowns. I hope that makes sense.  Also, this should only happen when the user clicks "submit."  I imagine that I would have to add a rule to the "submit" action in order to accomplish this.

     Any thoughts?

  • 04-29-2009 09:54 PM In reply to

    Re: How do I write a value to a metadata column on form submit?

    Hi SlingerOnline,

    I don't quite understand this. You say you want to automatically number a newly submitted document. Well, that requires some locking to prevent another user from submitting at the same time and getting the same number. Why not use a GUID for that? You could generate a GUID on submit and that would be unique for the document. Our free qRules tool has a GUID generator command so you don't have to write code. Just call the command with a rule.

    But, I'm probably confused and this isn't what you want. You are probably saving some data in a form based on the other references or something, but I don't quite get that. Sorry, but if you could maybe show some images and steps and before/after, etc. I might have more of a clue ...

    Patrick Halstead
    Project Manager at Qdabra
  • 04-30-2009 05:18 AM In reply to

    Re: How do I write a value to a metadata column on form submit?

    Nope, close, but not quite.  I've got the autonumbering portion down, that's not an issue.  The autonumber value however, will need to be applied to other documents.  Here is a little more detail. 

    User clicks "New."
    New form is generated, with autonumber sequence for file name (Form-001)
    Using a drop down pick list in form, user selects a document from document library.
    User clicks submit (which will also cause all form controls to be disabled, I've already got that worked out.)
    Form autonumber value is applied as metadata to documents that were selected in dropdown list.

    Hope that makes it a little clearer.

  • 05-07-2009 06:48 AM In reply to

    Re: How do I write a value to a metadata column on form submit?

    Have I stumped everyone?  I didn't think it would be this difficult.

  • 05-07-2009 07:40 AM In reply to

    Re: How do I write a value to a metadata column on form submit?

    So the form library where the documents that can be selected in the DDL has an additional column that you want to populate w/ this new id? I know you can use CAML to add items to a list -- see this post by Matt Faus.

    It strikes me that as long as you have the list ID of the form that you want to update, you'd be able to apply the same type of technique.
    Hilary Stoupa

  • 05-07-2009 10:49 AM In reply to

    Re: How do I write a value to a metadata column on form submit?

    I checked the link, and unfortunately it is extraordinarily confusing.  I will have to walk through it step by step to see how it applies to what I'm trying to do.  Also, I should note that it is not the form itself I am trying to update.  But a column of metadata for documents contained in the library that are selected in the form. 

  • 05-07-2009 11:18 AM In reply to

    Re: How do I write a value to a metadata column on form submit?

    I'm afraid updating a SharePoint list is more complex than you may have hoped. Matt's tutorial would help you understand the steps involved, I think, even though it has to do with adding items rather than updating existing items. Also, this link has more info on CAML.

    Hilary Stoupa

  • 05-07-2009 11:41 AM In reply to

    Re: How do I write a value to a metadata column on form submit?

    It shouldn't be that over-complicated.  I am able to retrieve any information from the list without any issues using the owssvr.dll. (They thoughtfully left the "filename" attribute out of the default data connection.)  I can post back to the list with no issues also.  But updating an item that already exists in the list, with some information from the form I am using, seems to require a congressional act.  I would have hoped that a rule on submit would suffice. (I thought it should anyways.) The ID of the form itself is irrelevant.  The action to update the list item should only happen when the form is submitted.  And I appreciate your help, really I do. But this is maddening. (It's also one of the last two things I need to get done before I can deploy this form for use here.)

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