InfoPath Repeating Group with Data from SharePoint and User Input - sharepoint

I have a series of questions which are pulled from a SharePoint list and loaded into a repeating section. The section has three elements, the Question # (from SharePoint), and Question itself (from SharePoint), and a drop down box Yes/No (NOT from SharePoint)...
The repeating group portion works just fine, it is pulling all Question # and Questions from the SharePoint site, but I cannot bind the drop down box (yes/no) to any sort of local data source in order to record the information.
Essentially what I have is a dynamically generated form which pulls questions off a SharePoint and a user will answer Yes or No for each question. I cannot associate the Yes/No drop down with anything because it resides within a Repeating section...
Thanks for any help!

I think the problem is that you are basing your main datasource on the sharepoint data. As soon as you base your Main Datasource on a webservice (Sharepoint or self-built) then it cannot be modified without modifing the webervice.
There are a couple of ways that you could go about achieving your desired result.
Create a webservice that retrieves the data from Sharepoint and then serves up a pre populated form.
Add a secondary datasource (Retrieve) to the form and then add the data to the repeating section with code.

You can add rule triggering submit connection at yes/no dropdowms.

The way I achieved this is as follows:
I did not use the wizard to handle all of the data binding.
I created the repeating group, with all the fields that I wanted to appear in each iteration of that group.
From there I wrote code to populate that repeating group with information that I got from various SharePoint sources. (e.g. Question #, Question Body)
When it came time to populate the "answer" control that a user can interract with I simply shoved a 0 in there for the value.
At the end, when I submitted, I traversed through the repeating group and constructed a CAML document based on the answers.
From there, I shot the answers to a SharePoint list, and shoved the form up on a SharePoint library.
The links Nathan shared with me might not outline this in full detail, but were very helpful!

Related

Infopath - Parent / Child Forms for Sharepoint

I need to implement a solution for a client SharePoint Office 365 site. I know you can do things with 3 parts solutions or Jquery but I'm trying to keep it OOTB as possible. Here is a simplistic view of the scenario.
There is a list called Parent. It has one field Title.
There is a second list called Child. It has one field Title and another Parent
Parent is the type Lookup and points to the Title field of the Parent list.
The SharePoint form is for the Parent List so the main connection points there.
I simply want to create a data connection to the child list and have the Edit / View pages populate that a listbox with the ID(Value) and Title(Display) from the corresponding match in the Parent list.
I've tried several ways but I lack the experience to probably describe what I've tried (Using Rules and the lists.asmx as well as a retrieve data connection to child and filtering it upon load).
Thank you in advance, I really need to get this implemented.
As per your query, I understand you want to open the form on the click of the list item with the view & edit.
for that you have to create the rules with the proper actions like if I click on the parent A then form open but after the form open we have to fetch the ID & title again by the create the connection who dynamically operate as per the call of action.if you need more details please mention comment on this / If I understand wrong the please brief your problem with the example.
Thanks

Handle click count for documents in SharePoint 2010

I am having a page with documents loaded in SharePoint 2010. I have three buttons below each documents in the page and they are 'Like','Unlike' and 'Comment'. So whenever people go there and see the documents they can click on any buttons of their wish.
My question is how to take the hit count of these buttons seperately and display it for each document. Is it possible to create a list with having these three columns and handle it using Client-Side scripting. Any suggestions or help is much appreciated.
Each item in SharePoint has a property bag that can contain ad-hoc data like this. You could certainly add additional columns to store this data and update those columns but that does mean that users could easily manipulate the values via the UI. Since the property bag is only accessible via the various API's, you wouldn't have this issue.
For an example of accessing the property bag via CSOM (which would be your best option since I'm assuming you want your users to be able to like, unlike and comment without refreshing the page each time), see this post reading and writing property bag values using CSOM
Another thing to consider for comments is the existing notes functionality that exists in SharePoint 2010 and SharePoint 2013. These comments are ties into the social functionality and may give you a bit more bang for your buck. To show the comments page for a particular list item see this post SharePoint Social Data using Javascript

How do I store this external data in SharePoint?

I am using Visual Studio 2010, SharePoint 2010 with custom document content types and forms. And plan to also use jquery to build the document add/edit/view forms.
I am developing a solution where I want to have a document library where each document uploaded also has a number of external data elements added as metadata.
The tricky part I'm trying to figure out is I want the user to be able to specify and add a multiple number of those same external data elements.
I'm trying to figure out how I represent the data internally in SharePoint. My initial thought is to programmaticly add hidden external fields as the users adds those external selections. But then I also think of simply storing those external elements as non-external text fields but have my own code which performs the external data lookup and validation.
I'm not adverse to significant custom coding, as I'm probably going to need to do a lot anyway since even the user interface is going to be a jquery tabbed form to enable all the external data the user will be able to associate with each SP document.
I've made an attempt to hopefully further explain what I'm trying to do and included that image. Essentially I'm wanting to add 1+ external data relationships to each document, as desired by the user.
It uses just example data. I'll actually have 4-7 different complex relationships much like the example. And the user is permitted to drilldown and select 1, 2 or all 3 of the dropdowns.
Think of it as similar to how here on Experts-Exchange we can add multiple zones to a question.
An example illustration is here: http://flic.kr/p/aFUSJn
Could you simply add a multi-line text column and have the user input the metadata with comma's, then use your code to seperate the data and do what you want with it?
You said you were not adverse to significant custom coding :)
One solution is to use SharePoint content types. The trick is that not all items in a list need to have the same content type.
Therefore, you can do the following:
As the user is selecting the fields he wants to use you generate or select a content type that matchs those fields.
You then add your document to the document list using the content template
You then have all your information strongly typed in SharePoint lists.
We have previously built a system where we generate content types based on xsd files, this worked very well.

Create custom field in SharePoint 2007 New Item Form

I want to modify a NewForm.aspx in a Task List to allow a custom string to be built. I have two fields, ID and Assigned To, and want create a third field that concatenates the two. Unfortunately, I cannot use the Assigned To column value in a calculated column.
I thought that I might be able to modify the form in SPD, but haven't a clue how to actually modify the field. This is what is present:
<SharePoint:FormField runat="server" id="ff1{$Pos}" ControlMode="New"
FieldName="Task_x0020_ID" __designer:bind="{ddwrt:DataBind('i',concat
('ff1',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string
(#ID)),'#Task_x0020_ID')}"/>
Any suggestions (not involving career changes) to get me started?
Thanks!
You will need to customize the NewForm.aspx using SharePoint Designer. A guide to doing this can be found here: http://office.microsoft.com/en-us/sharepoint-designer-help/create-a-custom-list-form-HA010119111.aspx#BM2
and here: http://kalsing.blogspot.com/2006/11/create-custom-list-form-for-sharepoint.html
Then to do the concatenation you are suggesting I would use Javascript to set the value of a field nested in a <tr> with class="hiddenRow". You can find some information about using Javascript to adjust your values on this page: http://blogs.msdn.com/b/sharepointdesigner/archive/2007/06/13/using-javascript-to-manipulate-a-list-form-field.aspx
A great place to find some examples of how this is done is to install one of the fab 40 (the bug Database for example) and then open the custom forms for those lists in SharePoint Designer.
I know that is a broad answer and not a specific how-to, but it is a big question involving many steps. Hopefully the above links point you in the right direction.
You could just use SPD to create a simple workflow that concatenates the two fields together (Build a dynamic string) and sets your new field (set field in current item) whenever the item is created.

SharePoint Multiple New Item Forms

I've got a custom list with a custom content type. I'm aware that when you create a new item you can see a drop down for the different content types on that list which I assume all have their own NewForm.aspx somewhere. I can specify in the content type definition which columns are shown on the New form and that I can replace the new form with a custom one of my own design.
What I'm trying to achieve is to have multiple New forms but for the same content type listed on the New drop down. I would like each new form to expose different fields of the content type. Additionally I'd like to make particular New forms only visable by users with particular permissions although this isn't critical.
Scenario:
I've got a content type with all the fields I need for a risk assessment. When a new item is created it only exposes fields to enter contact details. Once this is created a workflow with infopath forms then drives the gathering of the rest of the risk assessment information through booking, the inspection itself and approval of the data. I want the ability to have a second option to easily enter all this information on a different new form for an inspection that's already been done and needs logging in the system.
You could customize the NewForm.aspx (e.g. via SharePoint Designer) for the initial submission case. Obviously, all of the required fields will need to be populated in some fashion.
The EditForm.aspx is the out-of-box page for updating existing list items. You may be able to customize this to meet your update an existing risk assessment case. From the post above it's not entirely clear to me whether this distinction between these pages is fully understood.
In both of these cases, you can add code-behind to the .aspx pages. However, it's usually best to start as simply as possible, keep it as simple as possible and only add complexity as necessary.
Hope this makes sense and helps. Good luck!
Dan,
Per your scenario, I have done something similar by creating one content type per actor/stage. Consider using a simple SharePoint Designer workflow to change your content types onChanged (simply by setting the Content Type) column so that the perspective actors only see the columns you want them to see in the edit/newforms. As long as the proper content type is set, your users will only see the fields you want them to see. Furthermore, with creative use of views and audience targetting of pages you can somewhat prevent these users from seeing columns.
Also, you can prevent users from seeing the different content types (under the new button) in the advanced content type page.

Resources