Table with variable number of rows in MS Office mail merge [duplicate] - excel

I'm creating a compliance mailing for my organization, the mailing will include merge fields that identify the office location, physician, and SiteId. The mailing will also include a table of information that is dependent upon the particular SiteId.
I'd like to use the import table function of MS word and set up a query that references a merged field (SiteId) so that the inserted tables populate the appropriate data for the particular site. I'm unable to do this.
How can I set up this document so that I can import only records from my source (an ms access query) that match the SiteId merge field?

Word's mail merge does not support one-to-many relationships. There are ways to coerce it, but only one of them can yield a table as a result and over the years it has become less and less reliable as Microsoft has not regarded it as important enough to maintain...
What you need to do is set up a query that provides ONLY the information you want displayed in the table, plus the key (SiteId). It's best to sort it so that all the SiteId entries list together, and are in the order the data will come through in the mail merge data source.
On the Insert tab go to Text/Quick Parts/Insert Field and select the Database field from the list in the dialog box. Click "Insert Database" and follow the instructions in the dialog box to link in the data. Be sure to set the Query Options to filter on the first SiteId from the data source. When you "Insert Data" make sure to choose the option to "Insert as a field".
This inserts a DATABASE field in the document which you can see by toggling field codes (Alt+F9). The field code can be edited and what you need to do is substitute the literal SiteId value you entered for the query with its corresponding MergeField.
When you execute the merge to a new document that should generate a table for each data record corresponding to the SiteId for the record. But, as I said, Microsoft hasn't done a great job of maintaining this, so it may require quite a bit of tweaking and experimenting.
If the results are not satisfactory then you should give up the idea of mail merge and use automation code to generate and populate the documents.
You can find more (albeit somewhat out-dated) information on this topic at http://homepage.swissonline.ch/cindymeister/mergfaq1.htm

Related

MS-Access Automatically updating data based on another table (Email Blacklist)

I'm setting up a brand new database as a lot of the work we do is on multiple spreadsheets and a lot of the data is duplicated. I have a lot of knowledge with Excel, however, I feel that Access would much better suit the needs of the business and data management.
A large role for many in the business is to send emails/follow-up emails based on criteria, however, we use several services to do this and I need a new method of tracking people/businesses who have 'Opted-out' of email updates, we can export the people who opted out from the different applications and put into a spreadsheet.
I had a little play around with relationships to see if this would work, however, kept getting error along the lines of 'invalid for field type' and although I could do this with a simple countif function in Excel I was wondering if it's possible in Access without VBA.
One of the fields we have for our sponsors/delegates table is email address. I want to know if it is possible to create a new form & table or something to do the following:
User loads form, clicks a button and selects spreadsheet with emails in Column A
Data from column A is then imported into a blacklist table
Access removes duplicates and adds the rest to a blacklist table
Access updates sponsor/delegate table field 'opt-out' to yes for any email addresses added to the blacklist table
Edit: Here are 2 screenshots of the separate tables
What I need Access to do is basically tick the box 'opt-out' automatically for all records where the email matches to one in the blacklist
A query to update the opt-out field in your Sponsors table for all records which have a matching email address in the Blacklist table is relatively straightforward, with the matching operation performed by a single inner join, e.g.:
update Sponsors inner join Blacklist on Sponsors.[Email Address] = Blacklist.[Email Address]
set Sponsors.[Opt-Out] = -1

How to create m2m relationship in PowerPivot

So I am trying to link an employee metrics pivot chart with an employee project table with one slicer. I want an employee slicer that manipulates all charts but the data is coming from 2 different places (SQL, Sharepoint). When I try to create a relationship based on Employees I get the following error: "The relationship cannot be created because each column contains duplicate values. Select at least one column that only contains unique values."
So one chart has quantitative items while the table has qualitative items and I want one slicer to manipulate both at the employee level.
I want to see all the data on both charts for the selected employee, and not just single items linked by unique values. I can use unique values, and have created relationships that one slicer can manipulate however I only get one record at a time that way and therefore the slicer has thousands of buttons (one for each record).
I wouldn't think this would be that difficult and I hope it's really not.
Please Help!
M2M relationships in PowerPivot will most likely cause more headaches than solutions unless you are aware of what you are doing. After some thought, I realized that I really do not want an m2m relationship because it would result in junk data for what I wanted. I just wanted to start my answer off acknowledging that I did not achieve an m2m.
So if you want to link SharePoint data to Excel here is what you need to do:
Export SharePoint data as an RSS feed. If this is something others will need to refresh then the rss file will need to be stored on a shared drive.
Add PowerPivot if you have not already done so. In PowerPivot get external data from other sources (rss feed) then add your file. To link data you will need a Unique ID to join tables on.

Finding Lookup item numerical values in MS Dynamics

I have a site powered by ExpressionEngine 2.5.x, using Freeform, integrated to post form data to MS Dynamics CRM 2011. The extension is nicely scalable, I can change the mapping, all that excellent stuff. My problem is how to find mapping values for Lookup fields in MS Dynamics.
I am trying to map form fields from the site forms, into MS Dynamics. Some of the fields are Lookups, in MS Dynamics. Our mapping calls out the numerical value of the Lookup item, rather than its name. (Which is good, because ppl can change the text names in the MS Dynamics console without breaking the mapping.)
My question is: I know how to find the actual back-end field names of form fields within MS Dynamics. But how to I find the numerical values of the picklist items and lookup fields? Say I have a Lookup field, for Lead Source (called campaignid). The items are:
web
online
radio ad
flyer
word of mouth
other
I know that when I edit options in an option set, I can see their numerical value. Where can I edit options in a lookup field? I've tried looking under Settings > Customizations > Customize the System, but didn't see anything called lookup.
Lookups are pointers to entities. They do not have numerical values like regular option sets. So I guess that you will have entity called Campaign (or lead) so you can check which campaigns exist in the crm DB where each entity will have view in the DB.
Let's see if i understand your question. You don't have a Lookup option like Option Set because a lookup is consequence of a relationship 1:N between two entities. So for edit a lookup you need edit a record of a entity. In lookup fields you don't have numerical values, you have guid that represent individually a record, so in a record a lookup is stored in database as a guid. Check this video.
Check here how find this guid with the record open.
A look-up field is, roughly speaking a pointer to en entity (in C# it's referred to as EntityReference instead of Entity) and it consist mainly of a guid and logical name of something.
Usually, in the code, when you have an entity, in order to access the fields of its lookup-connected entity, you'll need to make an extra query for that.
So, if you have a Contact instance and need to see the address of its parent customer, you'll have to get the guid and logical name (in this case it'll be Account) and retrieve the data for it separately.
EDIT:
Suppose that you have created an instance of Contact entity and you'd like to access its lastName field. Then you can simply refer to it as follows.
var value = Xrm.Page.getAttribute(“lastName”).getValue();
On the same form, there's also a field that refers to an Account instance (its name is parentCustomerId. Suppose now that you'd like to get the fullName field of the Account. One could expect the following to work.
var account = Xrm.Page.getAttribute("parentCusomterId").getValue();
var name = account.getAttribute("fullName").getValue();
However, that's not going to work, because the parentCutomerId is a look-up field. It means that it only contains a guid (a pointer, a reference) identifying an other entity. You'll have to use it (the guid) in order to fetch the instance that the look-up is "mentioning". Then you'll be able to check it's properties.

Append Query From Access Into Linked SharePoint List with Lookup Fields in SP List

I am trying to append records in an MS Access table (I am using Access 2010, but can use 2007 if need be) into a linked SharePoint list.
There is an attachments field (when viewed from Access), but I am not concerned with appending these.
The SharePoint list has a few lookup fields, that in design view are of the Number format. Upsizing to SQL Server, I can confirm that they are numbers (and I assume the Id for the related SharePoint list object).
I copied the structure of the SharePoint list and pasted into a MS Access table, and then filled in a few sample records
I used the query wizard to select all of the fields of the Access table (minus the Access table's autonumbered ID and attachments), click "Append", and then selected the SharePoint list.
If I run this query, I get the error that X record(s) were not appended due to validation violation reasons, which is all of them. I've checked all field definitions and none are defined as required or have a validation constraint.
The only thing I can think of is that there is some issue with the Lookup fields, but each number Id I've checked is a valid Id.
I'm hoping for a MS Access solution, but if the only approach is to programmatically do it, could someone send me directions on how to get started with the SharePoint 3.0 SDK?
Thank you for your time.
Lookup columns are not number type even your parent items are of number type reason behind lookup column always attaches the item id of parent item.If you want to see the data in access kindly use the "export to Access" functionality available in datasheet view
I have linked to a SharePoint table, then appended directly to it from a query.
My issue is that this process takes a very long time to push up to SharePoint, then 2 times as long when first I need to delete the records currently in the list before appending.
Is there a better way to blow out and create the table while preserving the link since it is not an Access object?
Anyway I hope this may help you out some and get me some insight as well.
Regards.

Sharepoint: Person column in custom list

I have a Person field in my custom list. I want to have a view that will show multiple fields from that Person instead of the one I had to choose when creating the Person column.
So basically I want to have one column for Person and then in the view see Name, title, email, phone. All of those are valid choices but I can only pick one right now.
I really want to avoid typing in the username lookup for each column I choose to display.
This is SP 2007
It sounds like you need to create a custom fieldtype (with a fieldcontrol) that inherits from the userfield but in viewmode renders out the different columns you need. Is that something along the lines you are looking for?
http://www.sharepointblogs.com/nicksevens/archive/2007/08/31/create-custom-field-types-for-sharepoint.aspx
Note: This link is broken
You probably want a Computed Field. Note that this is not a Calculated Column. A Computed Field is what is used to display the same data is different ways. In SharePoint there is a Title field, but there is also a "Title (linked to item with edit menu)" computed field as well as a "Title (linked to item)" computed field.
See midway down this link for more details. I'm not sure if it will have all of the power that you need, but if it does it is almost certainly what you are looking for if you don't mind getting into the Schema XML file a little.
Could you use a DataView web part for this? If it's just a question of viewing the data that might be suitable.
Came across this thread and thought I'd add a tip. This suggestion is clearly not for every use case, but may work well in situations where you're managing a list rather than allowing manual inputs (verified to work with SP 2013):
Create a spreadsheet with columns to match your SharePoint list that contains multiple profile fields. (for example: name, phone number, email address)
In the spreadsheet, enter the same email address in all of the person/group field types in that row. (e.g., boss#company.com, boss#company.com, boss#company.com)
Select and copy the row(s) you wish to transfer to SharePoint.
In SharePoint, change the list view to "Quick Edit" and paste the row(s) into the grid.
SharePoint will process each field and convert the email address to the profile value you selected during the list setup.

Resources