Saturday, November 11, 2017

Copy and modify a data source

Copy and modify a data source

There are certain situations in which you may want or need to copy a data source connection before you modify it, including:

  • When you are working with Microsoft SharePoint lists and libraries and you want to create a custom query.

    The data source connection for SharePoint lists and libraries displays data from a default query that cannot be modified. However, if you copy a data source connection for a SharePoint list or library, you can then create a custom query.

  • When you are working with a database, and you want to create several data source queries that are based on the same source data.

You can copy and modify other data source connections in the Data Sources list. When you click Copy and Modify, you create a copy of the connection, and be able to modify any of the details in the connection.

You can modify the query for SQL-based data sources, such as SharePoint lists and libraries and database connections. For other data source connections, there is no query to modify. However, you can modify other properties for those data source connections.

In this topic

About copying and modifying data sources

Copy and modify a data source connection

About copying and modifying data sources

This section provides information on when you would typically want to copy and modify a data source.

SharePoint lists and libraries

Microsoft SharePoint lists and libraries that appear in the Data Sources list are connections to the original data, and they display the results of a query on that data. Unlike with queries for other data sources in the Data Sources list, you cannot modify queries for data sources that are automatically created for SharePoint lists and libraries. You can, however, copy a connection to a SharePoint list or library and then create a custom query to apply to the list or library in order to display the exact data that you want.

Database connection

You can modify a query for a database connection both quickly and easily. However, if you have several queries, all of which you use on a regular basis, you may find it convenient to save each individual query as a separate data source.

For example, Northwind Traders, a gourmet food company, tracks their products in an SQL database. The default query on the database displays all of the products that Northwind Traders has ever ordered. A team member suggests that another query be created to display only those products that have been discontinued. This result can be easily accomplished by copying the first data source query, modifying the query so that it displays only the discontinued items, and then saving the modified query under a new name as a separate database connection in the Data Sources page.

XML file

As with SharePoint lists and libraries, you cannot modify the data source connections that are automatically created for local XML files. However, you can copy and modify local XML files in order to modify the name of the data source, add a description, or add keywords. The name, description, and keywords for an external XML file can be modified without first copying the data source.

REST, RSS, and server-side scripts

Copying and modifying a connection to a server-side script might be helpful if you need to connect to that same server script but with different parameter values.

SOAP Web Service

Copying and modifying a SOAP Web service might be helpful if you need to connect to the same Web service but want to use either different methods or different parameter values.

Linked data sources

Copying and modifying a linked data source may be helpful if the linked data source is composed of database connections and you want to create a copy of the first linked database connection in order to modify the query.

Top of Page

Copy and modify a data source connection

  1. Click Data Sources on the Navigation Pane.

  2. On the Data Sources tab in the gallery, right-click the SharePoint list or library that you want to copy and then modify, and select click Copy and Modify.

    The Data Source Properties dialog box appears.

  3. On the General tab, in the Name box, do the following:

    1. Type a name for your new data source.

      Note: If you don't type a new name for the copy of the data source, the name will be the same as that of the original data source, but with _copy(1) appended. For example, if you copy the Announcements data source connection but don't type a new name, the name of the new data source will be Announcements_copy(1).

    2. In the Description box, type a description for your new data source.

    3. In the Keywords box, type any keywords that you want.

  4. On the Source tab, for information about what you can modify, refer to the following table:

If your data source connection is a

In the Source tab, you can

SharePoint list or library

Specify a query for your new list or library.

For more information about creating a query, see the See Also section.

Database connection

Specify a query for your new database connection.

For more information about creating a query, see the See Also section.

REST, RSS, and server-side scripts

Add or modify the parameters, as follows:

  1. On the Source tab, under Add or Modify Parameters, do one of the following:

    • Click Add.

    • Click the parameter that you want to modify, and then click Modify.

  2. In the Parameter dialog box, type a name for the new or modified parameter, and then type a default value for the new or modified parameter.

    Note: If the server-side script uses a parameter that was entered by a user who was visiting the site, select the The value of this parameter can be set via a Web Part connection check box.

  3. Click OK.

SOAP web service

Modify parameters, as follows:

  1. On the Source tab, in the Parameters box, click the parameter that you want to modify, and then click Modify.

  2. In the Parameter box, type the parameter that you want to use.

    Note: If the Web service uses a parameter that was entered by a user who was visiting the site, select the The value of this parameter can be set via a Web Part connection check box.

Top of Page

No comments:

Post a Comment