Different default Values for each row in a Repeating Table based on the formula - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Different default Values for each row in a Repeating Table based on the formula

Last post 07-26-2016 01:28 AM by Yugeswaran Vasudevon. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 12-08-2009 03:23 PM

    Different default Values for each row in a Repeating Table based on the formula

    I am a newbie in SharePoint and I was just wondering if you could help me on the following question. 

    I have put together an InfoPath form to record the surveys for one of our business processes. I have a repeating table which has the following 5 columns.
    1. Question
    2. Yes
    3. No
    4. N/a
    5. Comment
    I have also added 5 more rows to the repeating table by going to
    Tools-->Default Values, to accomodate more questions. I was able to specify
    the default values for each "question" field (text) by typing in some text. I
    also wanted to specify a conditional default value (using a formula) for
    "Comment" field in each row. But it seems that we can't specify a different
    formula derived default value for different rows in the repeating table. If I
    set the default value of "Comment" field in first row using a formula, the
    same formula is being applied to the "Comment" field in the rest of the rows. I need to have the text populated in the "comments" field automatically based on the answer the user chooses. The problem is that the possible set of comments is not the same for each question. 

    I have been struggling with this problem for the past one week. I would
    greatly appreciate it you could help.

    Filed under:
  • 12-09-2009 10:04 PM In reply to

    Re: Different default Values for each row in a Repeating Table based on the formula

    you cant set different default value to different rows of a repeating table using UI, you will have to do a little bit of coding for that.

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 12-09-2009 11:38 PM In reply to

    Re: Different default Values for each row in a Repeating Table based on the formula

     It sounds like you can store the various comments in a secondary data source, and then use a formula that incorporates the user's answer to retrieve the right one from that secondary source.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-10-2009 06:39 AM In reply to

    Re: Different default Values for each row in a Repeating Table based on the formula

    Qazi Anis:

    you cant set different default value to different rows of a repeating table using UI, you will have to do a little bit of coding for that.

     

    Hi Qazi,

    Thanks a bunch for your reply. I am a novice programmer and I haven't done any programming in InfoPath yet. Would you please walk me through how to do it in coding? I would appreciate your help.

     

    Filed under:
  • 12-10-2009 06:50 AM In reply to

    Re: Different default Values for each row in a Repeating Table based on the formula

    Jimmy:

     It sounds like you can store the various comments in a secondary data source, and then use a formula that incorporates the user's answer to retrieve the right one from that secondary source.

    Hi Jimmy,

    Thanks for your reply.I was trying to do this using a repeating table. Since I can't use a different default value using a formula for different rows in a repeating table,  I think this approach will not work. I know that I can use a layout table instead and place some controls. But I would end up using too many controls (3 times the number of questions) instead of 3 controls. This approach would also be very cumbersome. I would appreciate if you have any other ideas.

    Filed under:
  • 12-10-2009 08:05 AM In reply to

    Re: Different default Values for each row in a Repeating Table based on the formula

     Please try the attached XSN.  No code needed.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-11-2009 12:17 PM In reply to

    Re: Different default Values for each row in a Repeating Table based on the formula

    Jimmy:

     Please try the attached XSN.  No code needed.

    Jimmy,

    You are the man!! It works like a charm! Thanks very much for your help!. I have another column called "Score" in the repeating table, which would be "1" for "Yes", "0" for "No" and blank for "N/A" for 98% of the questions that I have. But for the 2% of the questions, answering "Yes" for a question is supposed to populate a score of "2" for "Yes" instead of "1".How would I go about accounting for these exceptions? Can I use the xml datasource for this as we are doing with the "Comment" column? If yes, can you please tell me how?

    Another question I have is that is there a way to enforce the relationship between the questions in the repeating table meaning if a user answers a question "No", the answers for the related questions should automatically be "N/A" and the user shouldn't be allowed to change the answers (conditional formatting is also fine).

    Thanks again for your help!!

    Filed under:
  • 02-29-2012 12:56 PM In reply to

    Re: Different default Values for each row in a Repeating Table based on the formula

     If the formula of the default values for each instance of the Repeating Table are the same, should not be a problem. Currently I am having problem where for different instance the default value formula need to be different. Seems InfoPath just cannot handle this, isn't it?

  • 07-26-2016 01:28 AM In reply to

    Re: Different default Values for each row in a Repeating Table based on the formula

    Hi Jimmy.. Can you please teach me how you set the default value for field 2? I'm a newbie to InfoPath and SharePoint.. Hope to hear from you soon.
Page 1 of 1 (9 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.