3

I have created InfoPath form that collects information from the user (name, department, manager etc...) using GetUserProfileByName method. I have also created a workflow for this form so that once it is submitted, it will send an email to his manager to approve this form.

While workflow is working fine, every time the manager open the form, his data is populated on the field instead of submitter's (Obvious since it will collect data from logged-on user). Another field that is not using GetUserProfileByName method was not affected.

Is there a way to preserve the value once the form was submitted? Rule on Form Load

  • You need to NOT use the current user when the form is opened by the manager. – Matthew McDermott Jun 8 '17 at 3:06
  • Yes that's the idea, any way to do it? – Mazuan M. Jun 11 '17 at 0:27
2

Create a rule that checks if the value is blank before fetching the User Name. Then when the manager opens the forms the value will be present and your code will detect and not change the value.

  • When I created rule on Form Load that when User Name field ( autoObserverName in my instance) IS BLANK, it is still retrieving manager's value. Strangely, when I set condition of User Name field IS NOT BLANK, both submitter's and manager's value are not populated. I have included the screenshot on original post. – Mazuan M. Jun 13 '17 at 2:33
  • After querying the data, are you setting the value of autoObserverName? – Matthew McDermott Jun 13 '17 at 11:39
  • Which value are you referring to? I set the field's value when Name="PreferredName". If you're talking about Set Sample Value in Data Connection Wizard then no i didn't set any value to it. – Mazuan M. Jun 14 '17 at 1:54
0

Found a workaround for this.

I created hidden field Person that store value from ObserverName field.

Then i created rule on Form Load that check if Created By field is NOT blank, it will not query for data connection then set ObserverName field with value from Person.

I chose Created By field because it sure contain value after the form have been submitted though you can choose any other non-blank field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.