Can a SharePoint Workflow write to an InfoPath form? - InfoPath Dev
in

InfoPath Dev

Can a SharePoint Workflow write to an InfoPath form?

Last post 10-03-2011 01:23 PM by smonczka. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 09-29-2011 10:56 AM

    Can a SharePoint Workflow write to an InfoPath form?

    Is it possible to create a SharePoint workflow that will write to an InfoPath form?

    I have a form that list several to do items for different people. This is a master form that the manager for a group might use. The manager opens the request form and checks off what each person needs to do. when the form is submitted a workflow sets tasks for each person in a SharePoint Task List.

    When a user completes the task I want it to check off the associated task in the master form. The manager can then open up the form to see what has been completed and once a check box is marked true other rules fire off and other tasks are generated.

    But in short can a workflow populate a field in an InfoPath form?

    Using SharePoint 2010 Enterprise and InfoPath 2010 Browser Based Forms.

    Thanks, Steve   

  • 10-01-2011 06:39 AM In reply to

    Re: Can a SharePoint Workflow write to an InfoPath form?

    I'm not positive on this - but I wonder if you promoted the field and set it so it could also be edited from the library - it seems to me that in that case you should be able to set values for the form from your workflow....

    Hilary Stoupa

  • 10-01-2011 07:57 AM In reply to

    Re: Can a SharePoint Workflow write to an InfoPath form?

    Hi Steve -

    To answer your short question, the answer is Yes. I'm guessing there is more to it than what you have written. But let me see if I can help break this down for you.

    Assumptions:
    --There are separate tasks that get sent to users to complete related to each task in the form. Separate, meaning different tasks which represent a different part of the process and not the one task to 3 different people. If it is the same task assign to 3 people then you need to approach the solution differently. For this response let's assume you have several steps in a process, each assigned to one person:

    1.) Initiate Order
    2.) Process Order
    3.) Post Order Cleanup

    You will need to have fields in your form that represent the status of these tasks. They could be in the form of a Checkbox, Radio Button or Textbox. My recommendation would be to use the Checkbox or Radio Button. You will want to set the data type properties for Checkbox to be boolean or Radio Button to a whole number - a whole number is easier to update from the workflow. You'll need to promote these fields when you publish the form. In the publishing wizard there is a screen that exposes all of the fields from the Form, select Add, pick your field from the list to promote. In the box below, InfoPath allows you to pick the mapping field from the form to SharePoint. If you don't already have a field in SharePoint, you can let InfoPath do this for you. Best Practice is to create your own Site Column and associate it to a Content Type. But this is the very important part - the name of this field is the name you need to know when you are want to update the status from the workflow. Finish by publishing the form.

    Now, to the workflow. When the task is complete for each step on the process, the next step in the process Add the Action "Update List Item" Use the Current List and then select the corresponding field you mapped from InfoPath. What I have found to be the best solution when setting the value for a checkbox field is to use the Fx (function) true() or false() for the value. Typing TRUE or FALSE into the value field doesn't always yield the results you are looking for.

    So hopefully this will help you along. If you have the same task assigned to multiple individuals then it's a little more complicated and would most likely require developing an example form.

    Something else to consider is what to do when the workflow is cancelled. If you have 2 of 3 tasks completed and someone terminates the workflow. Your form is left in a state with two tasks completed and no corresponding process to complete the 3rd task. If this happens you'll either need to manually uncheck these fields or put a cleanup task in there that can address this and check to see if and of the previous tasks have been completed and set there value to false() if you intend to restart the process again. This is in most cases the hardest part of developing forms and workflows is dealing with the variety of outcomes. Getting the form and workflow to behave base on a successful completion of a given process is usually very linear and easy to implement.

    Hope this helps. Let me know if there is something I miss understood.

    Scott
  • 10-03-2011 01:09 PM In reply to

    Re: Can a SharePoint Workflow write to an InfoPath form?

    Hilary thank you very much for responding.  Though I have used that fix for other situations it would not work for this one as I need the workflow to write back to the form so users can open the form to see what has tasks have been completed.  This allows them to chose to kick off other workflows if needed / or not.  I find it hard to beleave I am the first one ever to try having a workflow write to a form? 

    Again thank you very much for taking the time to write me back.

    Steve

  • 10-03-2011 01:23 PM In reply to

    Re: Can a SharePoint Workflow write to an InfoPath form?

    Scot thank you very much for your reply. Yes you understood exactly what I was trying to do. And it looks as if this will fix my issue. Though with the amount of tasks I have to create, my whole solution may take to much time to complete. We are creating an OnBoarding process for new hires. This form would be initiated by HR. Once submitted workflows would be fired off for each and every task associated with a new hire, i.e. make AD account, get desk equipment set up, phone number, email address, business cards and so on. The process would actually go out to a year after the new hire was hired with a final reminder to the HR department to schedule the employees yearly review. In at last look there were 175 different tasks that needed to be set. I may have to review this project and see if it will be worth the time.

    Sorry about that... What I meant to say was thank you again for your help. :)  I can still use this solution for another project I’m working on so your time will not have been for not!

    thanks,

    Steve

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