Showing related items from a SP list based on user-selected field - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Showing related items from a SP list based on user-selected field

Last post 09-26-2014 02:13 PM by Bre Huston. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 09-18-2014 08:47 AM

    Showing related items from a SP list based on user-selected field

    I am building a list form in SharePoint online, using InfoPath. The list is a "knowledge base" with questions, answers, and a category field. I am trying to build in a function in the InfoPath form so that when a user selects a category from the drop-down list, that triggers a display of related Q and A on the form (with the idea that the user may see their question is already in the database and not submit a new one - sort of like the Related tab in this forum). Here's what I've done without success, please tell me what I'm doing wrong... 1) Created a secondary data connection to the list, pulling the Q, A, and Category fields. 2) Added field form boxes for Question and Category (choice dropdown) 3) Added a text box (called Related) 4) Added a rule to the Category field (Add Rule -> When this field changes) for Action->Set a Field's Value. 5) In the Action: Set a Field's Value dialog box, set Field to Main:Related (the text box); set Value to Insert Formula->Insert Field or Group-> MyFields:DataFields:Question (under Knowledge Base (Secondary) as source of fields) 6) In this selected field (MyFields:DataFields:Question (under Knowledge Base (Secondary) as source of fields)), select Filter Data. Pick Add. Under Display data that meets the following criteria, pick: Select Field or Group: Knowledge Base (Secondary): Data Fields:Category EQUALS Select Field or Group:Main:Query Fields:Category 7) Publish form. When I go to the published form in the browser (in SharePoint) and select an item from the Category dropdown, nothing happens in my text field. I'm honestly not sure if I need to correct a minor error or if my whole approach is misguided. Please help a newbie out!
  • 09-19-2014 02:11 PM In reply to

    Re: Showing related items from a SP list based on user-selected field

     Hello dsnyder,

    Thank you for your question. The scenario you listed above is actually a very common request in InfoPath forms. Cascading dropdowns are going to be the method you'll want to use.  We often add a helper field, which in this case could be the category list. Add a rule to set the query category value when a user selects a category from the dropdown in the form. The action will then be to query the secondary data source and display the secondary data with only the questions and answers.

    If you need more details let me know and I can design a quick example form. 

    Thanks!

    Bre 

    Bre Huston | Form Designer

    Qdabra® Software / InfoPathDev.com / FormsQuo877.544.2389 main / 425.318.7843 direct

    Business Process Automation for Everyone – Streamline data gathering to turn process into knowledge.™

     

  • 09-22-2014 07:54 AM In reply to

    Re: Showing related items from a SP list based on user-selected field

    Thanks for the reply, Bre! Can you explain the role of the "helper field" a little more? Right now I created a secondary connection to my list, then added a rule to "set value" to a text field when the user selects a category in the category field (with the value coded as q and a fields from the list when category from category field equals category in secondary connection) and basically nothing is happening when I publish and pick a category. I wonder if this "helper field" is what is missing? Any advice or examples would be great! Thanks, David
  • 09-23-2014 10:10 AM In reply to

    Re: Showing related items from a SP list based on user-selected field

     Hello David,

    Please take a look at the attached example. I have customized the list form. In the example, the categories column includes a dropdown of categories. When a category is selected, the list is queried for existing Questions/Answers from the list and displays them as read-only in the form.

    Thanks!

    Bre 

  • 09-23-2014 11:09 AM In reply to

    Re: Showing related items from a SP list based on user-selected field

    Thanks, Bre! When I try to open the attached item in Infopath, I get a permissions-related error message (attached). Can you help? David
  • 09-23-2014 11:09 AM In reply to

    Re: Showing related items from a SP list based on user-selected field

    Thanks, Bre! When I try to open the attached item in Infopath, I get a permissions-related error message (attached). Can you help? David
  • 09-24-2014 03:34 PM In reply to

    Re: Showing related items from a SP list based on user-selected field

     Hi David,

     Because the data connections exist on our site you will not be able to preview the form. The attached example is for you to take a look at the logic. A similar method should work for your desired outcome.

    Bre 

  • 09-24-2014 03:42 PM In reply to

    Re: Showing related items from a SP list based on user-selected field

    Looks like you are trying to open the form instead of opening in design mode? Save the file locally. Right click and select Design to open in the designer.

    Hilary Stoupa

  • 09-25-2014 01:19 PM In reply to

    Re: Showing related items from a SP list based on user-selected field

    Thank you Bre and Hilary! Hilary's suggestion to right-click and pick design rather than open in the downloaded file worked, and I was able to see the file. Bre: I was able to replicate your example for my list form, but there is one thing that left me confused. The only way I could create the "repeating section" in my list form was to copy and paste from your form. Then I could recreate the behavior. I could not do so from my list form directly... After some searching, it seems as though if you create a list form from the "Edit in Infopath" button in SharePoint, you do not have the "repeating section" option. Even when I go to the Data Connection, there is no option available to turn on "multiple fields from the item" choice. Does this mean, basically, that if I want to have this sort of behavior in an Infopath form, I have to create it directly in Infopath? Is there a logic or rationale to this behavior? Many thanks again for your help. David
  • 09-26-2014 02:13 PM In reply to

    Re: Showing related items from a SP list based on user-selected field

    Hi David,

    In order to replicate with a list form, I would change the field to a dropdown in the designer, and add choices manually to your "categories" list. In this instance, you will need to query 1 category at a time.

    Thanks!

    Bre 

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