Infopath preview shows correct information but will not show in SP once published - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Infopath preview shows correct information but will not show in SP once published

Last post 02-07-2018 12:43 PM by etipton. 19 replies.
Page 1 of 2 (20 items) 1 2 Next >
Sort Posts: Previous Next
  • 02-06-2018 09:21 AM

    Infopath preview shows correct information but will not show in SP once published

    I am trying to autopopulate the current user in a field where the username=SP username. Once I put the rules in it shows correctly in the preview in infopath. Once i publish it in SP, it does not autopopulate like I need it too. What am I doing wrong as far as publishing it? I have attached to screen shots of what I am seeing.
  • 02-06-2018 09:26 AM In reply to

    Re: Infopath preview shows correct information but will not show in SP once published

    The userName() function may be including a claims prefix when published & opened in the browser. Can you put a calculated value on the form that has the userName() function for its value to see if there is a difference between preview & browser?
    Hilary Stoupa

  • 02-06-2018 10:16 AM In reply to

    Re: Infopath preview shows correct information but will not show in SP once published

    I have tried that. when i do username=username() in preview it works. In sharepoint all the usernames have i:0#.w|bhate\ before the username so I tried adding that to the substring-after then the username(), "i:0##.w|bhate\ and it still didn't work in sharepoint. when Ii add the substring-after to it, it does not show in preview
  • 02-06-2018 10:28 AM In reply to

    Re: Infopath preview shows correct information but will not show in SP once published

    I'd think you'd need the domain, I'd try substring-after i:0##.w| myself. I'd assume it won't work in preview, because the user name won't have the prefix.
    Hilary Stoupa

  • 02-06-2018 10:48 AM In reply to

    Re: Infopath preview shows correct information but will not show in SP once published

    This will just work for myself though. I need to autopopulate the field with the current user. I know when I put in the substring-after(username(), "i:0#.w|bhate\") it will bring up the current username ex: etipton in SP. I have an employee list that I need the username to reference. i have created a rule that the value is the fullname on the employee list and the filter is username=username() with a condition of run when firstname is blank. Both Full Name and Username are columns on my SP list. This rule works in preview but when published does not work. Sorry I wasn't explaining it better earlier.
  • 02-06-2018 10:54 AM In reply to

    Re: Infopath preview shows correct information but will not show in SP once published

    Can you attach a copy of your form under the Options tab in a reply?
    Hilary Stoupa

  • 02-06-2018 10:59 AM In reply to

    Re: Infopath preview shows correct information but will not show in SP once published

    It is very basic file. It's more/less a learning file for me to figure out how to do it.
  • 02-06-2018 02:54 PM In reply to

    Re: Infopath preview shows correct information but will not show in SP once published

    So - I don't see the substring-after function in your filter. I still don't really understand what the issue is, outside of that - I'd expect once you've added the substring-after function, when you open the form in the browser, you would see your first name. If someone else opened the form who was in your list, they would see their first name. If someone opened the form who was NOT on the list, they would see nothing, because the formula would return no data.
    Hilary Stoupa

  • 02-06-2018 03:07 PM In reply to

    Re: Infopath preview shows correct information but will not show in SP once published

    I added the substring-after several times to the formula. When i published it, it still showed nothing when I tried to do a new document in sharepoint. I thought it might be because of the list. So I created another SP list and tried it that way. Once published it would not show up the name even with the substring-after. The filter I have attempted to use is username equal to substring-after(username(), "i:0#.w|bhate\"). The username on my list is etipton and so forth. The i:0#.w\bhate\ is what is associated with the user in our sharepoint.
  • 02-06-2018 05:33 PM In reply to

    Re: Infopath preview shows correct information but will not show in SP once published

    I'm sorry I'm having so much trouble understanding the issue you are having. Perhaps this will help you - put the data fields from your list on the form. Add a formatting rule for what you think should select the right row (i.e. - username = substring-after, etc). Add another for the preview version. Then you can make sure the right row is highlighting in filler and the browser. Remember XPath is case sensitive.
    Hilary Stoupa

  • 02-07-2018 07:30 AM In reply to

    Re: Infopath preview shows correct information but will not show in SP once published

    I did the data field and here is step by step what i have been doing. I create a rule condition firstname is blank. Run action. Set Field Value is Firstname. Value= i open my data connection which is employee data in the value field. I select Full Name because that's the column name. I filter the data. username which is a column name. username = username(). This does it correctly in my preview but not SP. I created a second rule and changed the filter data to UserName = substring-after(userName(), "i:0#.w|bhate\"). With both these rules it brings up the preview correctly but still will not populate it in sharepoint. whenever i just put in substring-after(username(), "i:0#.w|bhate\ then it will bring up etipton on SP. I need it to bring up the full name of the user using the username and comparing it to the list because the username on the list is ex: etipton. i hope all this makes sense. If it would be easier maybe I could speak to you on the phone if possible.
  • 02-07-2018 07:40 AM In reply to

    Re: Infopath preview shows correct information but will not show in SP once published

    So the substring-after formula results in "etipton". The list has "etipton". Both are all lower case? In the browser, if you put a calculated value on your form with the substring after formula, you get "etipton"? If you put the list data fields on your form, you see "etipton"? Can you post a screenshot?
    Hilary Stoupa

  • 02-07-2018 08:32 AM In reply to

    Re: Infopath preview shows correct information but will not show in SP once published

    yes to the first question, yes to them both being lower case. yes to the calculated value question, if i put the list data field on my form and then filter it i do not see anything. The etipton that shows on the screen shot is from me not from filtering. It is just from putting in substring-after(userName(), "i:0#.w|bhate\") as the value. The screen includes step by step how I have been trying it.
  • 02-07-2018 09:03 AM In reply to

    Re: Infopath preview shows correct information but will not show in SP once published

    Drag the list data fields onto your form. Don't filter it. Publish your form. Open your form in the browser. Can you send a screenshot of that data?
    Hilary Stoupa

  • 02-07-2018 09:16 AM In reply to

    Re: Infopath preview shows correct information but will not show in SP once published

    This is a small portion of the data on the list. It was all i could fit on the screen.
Page 1 of 2 (20 items) 1 2 Next >
Copyright © 2003-2018 Qdabra Software. All rights reserved.
View our Terms of Use.