Can auto-generated "Created by" field be filled before a Save? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Can auto-generated "Created by" field be filled before a Save?

Last post 11-12-2018 07:21 AM by Hilary Stoupa. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 11-01-2018 04:22 PM

    Can auto-generated "Created by" field be filled before a Save?

    I have a form I am creating in InfoPath 2013. It has many people picker fields that are used to auto-send emails on new/change/etc. events in a SharePoint list via Flows. Two fields are using the built-in "Created by" and "Created" (date) fields that are part of every created form. They are working, but here is my conundrum: The "Created" field (date) auto-fills instantly upon creation of a new entry (ID). This is great, but the "Created by" does not fill until the form is saved and closed. Next re-open of the form it is properly populated. I would like to populate the "Created by" on creation of the list item, same as the date field is. The folks using the form are not too technically savvy, and will likely type something in there and/or complain they have to fill out this field, when in fact they don't. I tried making it read-only to block this, but you cannot do this with a people picker. I know how to get the log-in ID from the user and auto-fill a text box, but since this will be used in a Flow to send emails to that person I think using a people picker is mandatory (stores corporate email address). Anyway I can make it populate on creation, or stop a user from trying to type in there?
  • 11-07-2018 04:16 PM In reply to

    Re: Can auto-generated "Created by" field be filled before a Save?

    So - can't you just not display the field? Since it gets populated when the item is created, maybe just put it in a section and hide it if there isn't a value?
    Hilary Stoupa

  • 11-12-2018 04:50 AM In reply to

    Re: Can auto-generated "Created by" field be filled before a Save?

    So the issue is that the field is a people picker, necessary so that the Flows will have access to the person's email in the company directory. I had thought of your idea (use a Rule to hide the field if blank), but People Pickers use Groups, which cannot be selected as a condition in a Rule. So the question becomes: under what conditions do I hide the field?
  • 11-12-2018 06:31 AM In reply to

    Re: Can auto-generated "Created by" field be filled before a Save?

    Ya know, my response was delayed because I was on vacation, and I think the time away gave me the perspective I needed to see it in a different light - and I believe I found the solution. I still use the People Picker as needed, but for display in the form I created a new, read-only text box, and set its default value to equal the "DisplayName" of the People Picker. Technically that right there solves my issue because being Read Only the user cannot type into it. I took it a step further though and used Sections so that it's hidden while still blank (to avoid confusion) and the text "Auto-generated" is there in its place, and when it's NOT blank I display the Text Box, not the People Picker, so that the Read Only property prevents anyone trying to change it. I've been testing it and it works quite well, so I think this will be the solution I use.
  • 11-12-2018 07:21 AM In reply to

    Re: Can auto-generated "Created by" field be filled before a Save?

    Perfect, sounds like you have a workable solution. :-)
    Hilary Stoupa

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