Default values in one column of a repeating group. - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Default values in one column of a repeating group.

Last post 09-15-2016 08:33 AM by Hilary Stoupa. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 09-15-2016 05:20 AM

    Default values in one column of a repeating group.

     Hi

    I have a repeating group with 6 elements

    In every form I want to have 4 repeats of this group, each with a different LabourType.

    I have gone into default values and created defaults for each row.

     

    But when I open the form I get 4 rows all with the same value

      

     

    What am I doing wrong ?

    Thank you

    Catharine 

  • 09-15-2016 05:37 AM In reply to

    Re: Default values in one column of a repeating group.

     Hi

    I tried to put screen shots in my original post - I have tried to delete but it won't let me edit

     

    My data structure is

      <my:LabourTable>
       <my:LabourType/>
       <my:LTarget/>
       <my:LActual/>
       <my:LReason/>
       <my:LVar/>
       <my:LID/>
      </my:LabourTable> 

    I want a table like this on all forms

    LabourTypeLTargetLActualLReasonLVarLID
    Goods In     
    Slicing     
    H/Risk     
    Boxing     

    I have created default values by going to Data/Default Values... and adding LabourTable so I have 4 repeats.  I have then updated the default value for each one.  I have opened the default values again to ensure they have been saved.

    But when I open the form I get

    LabourTypeLTargetLActualLReasonLVarLID
    Goods In     
    Goods In     
    Goods In     
    Goods In     

    What am I doing wrong ? 

    I have created a brand new form and created a repeating group in exactly the same way - and the default values work correctly. 

    I have deleted the table in my original form closed the form, re-opened and added a table with similar naming convention - added the default values - and I still get the table created with the same value in each row.

    Thank you

    Catharine 

  • 09-15-2016 08:10 AM In reply to

    Re: Default values in one column of a repeating group.

    Can you send me a copy of the form, or attach it here? I'll take a quick look & see if I can see why it is being stubborn.... The results in your second table are what you see when you open a new, blank form?
    Hilary Stoupa

  • 09-15-2016 08:23 AM In reply to

    Re: Default values in one column of a repeating group.

     DUH!!! I am stupid - "New blank form" reminded me that I for testing I have a preview set - just so stop me having to fill in 4 starting values...

    I have removed the preview and all is working  -  sorry.

    As always thank you for your help !! 

     

     

  • 09-15-2016 08:33 AM In reply to

    Re: Default values in one column of a repeating group.

    Ah hah! - and so you know - this is the thing with default values if you decide to use this technique on an existing form, already in production - if you were to add a new repeating group w/ defaults to your form, and opened existing XML with it - you'd see the same result. Just something to be aware of. :)
    Hilary Stoupa

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