Populating a Infopath field with the 'Created by' SP field - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Populating a Infopath field with the 'Created by' SP field

Last post 12-01-2017 07:16 AM by Hilary Stoupa. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 11-30-2017 12:57 AM

    Populating a Infopath field with the 'Created by' SP field

     I've created a Data Connection to a SP Library and set up a Rule on the relevant field to Set the field as in the attached field. This is the code in the Xpath editor:

    Requesters_Name = xdXDocument:GetDOM("Createdby")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Author/pc:Person/pc:DisplayName

     but I'm getting the error:

     

    "Requesters_Name" does not point to a valid location path of a field or group.

     

    where am I going wrong? 


    Filed under: , ,
  • 11-30-2017 07:06 AM In reply to

    Re: Populating a Infopath field with the 'Created by' SP field

    First, your syntax isn't valid... if the rule is to set the field Requesters_Name, you'd want the target field set in the "Field" portion of the rule builder (see attached screenshot). Secondly, it appears that you are setting the rule on the same field you wish to set. This can be confusing at first, but it is important to remember that rules fire when a field changes. So, if you want to set requester name, and the rule is ON the requester name field, the rule will only fire if you do something else to change that requester name field! Also, if you set a field with a rule on that same field, you are likely to end up in a loop. Better to put your rule on form load (if appropriate) or whatever field / control queries for the data.
    Hilary Stoupa

  • 12-01-2017 01:12 AM In reply to

    Re: Populating a Infopath field with the 'Created by' SP field

     Thanks Hilary, that does make sense setting Rule on Form Load. I've done that and set the value to DisplayName and to Created By but I'm not getting anything returned?


  • 12-01-2017 01:13 AM In reply to

    Re: Populating a Infopath field with the 'Created by' SP field

     


  • 12-01-2017 07:16 AM In reply to

    Re: Populating a Infopath field with the 'Created by' SP field

    You are setting it to the query field, not the data field - at least that is how it looks in your screenshot? We use query fields to pass in a query filter (limiting the data returned). Data fields are where the data is.
    Hilary Stoupa

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