Set a Field's Value not returning the correct value - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Set a Field's Value not returning the correct value

Last post 09-20-2010 02:23 PM by Hilary Stoupa. 12 replies.
Page 1 of 1 (13 items)
Sort Posts: Previous Next
  • 09-18-2010 06:40 AM

    Set a Field's Value not returning the correct value

    First and foremost, this may seem like the most novice question possible but I’ve only been on InfoPath for a few days, so cut me some slack!  OK, my company is on SAP and we’re trying to develop a solid process for creating new positions in our system.  I’ve developed an InfoPath form that is accessible through out SharePoint site and it’s working pretty well.  So the process is when somebody wants to create a new position, they fill out this form and from a drop down (which is driven by a data connection on our SharePoint site), they select the position they want to create.  If you’re at all familiar with SAP, a position is tied to a job.  The data source/spreadsheet on SharePoint has a position and the associated job on each row.  So I built in some rules so that when somebody selects a position from a drop down, the job field is set (set a field’s value rule) based on that initial position select. 

    The Problem:  It seems to work in that it set’s the job field value to A job, but not the RIGHT job.  What I mean is, you select the position from the drop down and the rule references the data source and delivers back the first job on the list, not the job that’s tied to that position.  Again, I’m new at this but have spent so much time trying to figure it out and I’m about to lose my mind – PLEASE HELP!  Thanks.

    - Ryan Gibbons
  • 09-20-2010 07:28 AM In reply to

    Re: Set a Field's Value not returning the correct value

    Hello,

    You might have to add some fields to the form to debug this. Are there any intermediate values you can check to troubleshoot? There must be something in between selecting from the dropdown and the job field getting set. If you can post a screenshot or a description of the rules involved we might be able to give you some ideas to sniff out the issue.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 09-20-2010 08:36 AM In reply to

    Re: Set a Field's Value not returning the correct value

    Good point - thanks for replying.  Attached are some screen shots that I've numbered... First is the form I'd like our employees to fill out, second is the rule behind the form and the third is the rule imbedded in the form.  Again, the problem is the rule is filling in data in 2, 3 and 4, but it's not filling in the data that is associated in that row, just the first 2, 3 and 4 it see's on the SharePoint List.  Below is the process the rule should follow...

     1.  Person selects position from a drop down

     2.  Rule should populate position short text based on the position selected

     3.  Rule should populate job ID based on the position selected

     4.  Rules should populate job name based on the position selected

    - Ryan Gibbons
  • 09-20-2010 08:48 AM In reply to

    Re: Set a Field's Value not returning the correct value

    Hi,

    It appears the screenshots are asking me for credentials to an outside site.

    One think to look into is the function current(). You might be using . (dot) or an actual field name or xpath in a function, but using current() might help. (Sorry to not be more specific; hard to say without seeing the rule)

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 09-20-2010 10:03 AM In reply to

    Re: Set a Field's Value not returning the correct value

    Sorry for being a pain, I can't upload pictures/screen shots here.  Any change I could just e-mail them to you?
    - Ryan Gibbons
  • 09-20-2010 11:09 AM In reply to

    Re: Set a Field's Value not returning the correct value

     After clicking Reply, do you see the Options tab? It should allow any registered user to attach an image...

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 09-20-2010 11:43 AM In reply to

    Re: Set a Field's Value not returning the correct value

    Alright, attached.  As you can see, I'm really starting from square one....


    - Ryan Gibbons
  • 09-20-2010 11:44 AM In reply to

    Re: Set a Field's Value not returning the correct value

    This is the form on SharePoint


    - Ryan Gibbons
  • 09-20-2010 11:44 AM In reply to

    Re: Set a Field's Value not returning the correct value

    Rules


    - Ryan Gibbons
  • 09-20-2010 11:57 AM In reply to

    Re: Set a Field's Value not returning the correct value

    So regardless of what I select from the position long text drop-down box, it returns the position short text as Acct,Tax3 (because that's the first on the list), the job ID as 20159818 (because that's the first on the list) and the job name as Tax Accountant III (because that's the first on the list).  It almost like the drop down does a VLOOKUP but only pulls back the first value it finds and not the values on the associated rows of the position long text.

    - Ryan Gibbons
  • 09-20-2010 12:18 PM In reply to

    Re: Set a Field's Value not returning the correct value

    Hi --

    You need a filtered XPath, not a rule condition.

    Try this -- remove the condition on your rule set. The, for the first action, where you set PositionShortText, in the formula editor where you select the field from your SharePoint list (@Position_Short_Text), when you click "Insert Field or Group" you should have the option, when you select that field, to filter the data. That filter is where you want to set up the condition you currently have in your rule.

    Hilary Stoupa

  • 09-20-2010 02:05 PM In reply to

    Re: Set a Field's Value not returning the correct value

    Hilary - you saved my sanity!!!  Thanks a bunch for the advice and help.  This is going to be very helpful for our team.

    - Ryan Gibbons
  • 09-20-2010 02:23 PM In reply to

    Re: Set a Field's Value not returning the correct value

    It is one of those tricky bits -- when you start using IP, it seems like a condition is what you want.  Usually, though? What you really want is a filter. Glad we can help you stay sane!

    Hilary Stoupa

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