# Copy & Paste

Appfarm Create comes with rich possibilities for copy and paste at various levels. This article summarizes these features, including limitations.

## Duplicate, Cut, Copy and Paste

Right-clicking a component, such as the UI Component [Container](https://docs.appfarm.io/library/ui-components/container), gives you three options: **Duplicate**, **Cut** or **Copy to Clipboard**.

**Duplicate**

The selected element is copied and pasted directly (at the same location). This is handy for speeding up development by copying and making adjustments, or simply for making backups of a group of UI Components (duplicating the top-level container and hiding it by marking it `visible = false`)

**Copy**

The selected element is copied to the clipboard, where it can be pasted in a different location.

**Cut**

The selected element is removed from its current location and simultaneously copied to the clipboard, where it can be pasted in a different location.&#x20;

<figure><img src="https://29237295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiLU-xcHu0eLZiTxcmZ%2Fuploads%2FsIzqaIxoF1aLI8zqMZEH%2Fimage.png?alt=media&#x26;token=a1cfc54a-f64b-4f86-887b-4267396e226a" alt=""><figcaption><p>Duplicate, Cut or Copy to Clipboard</p></figcaption></figure>

**Paste**

Having an element on the clipboard, you can right-click and **Paste** it. You are only allowed to paste it at a suitable place - e.g. you may not paste a Container inside an Action.

<figure><img src="https://29237295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiLU-xcHu0eLZiTxcmZ%2Fuploads%2FieLUGiFbaYZEHzA43uGZ%2Fimage.png?alt=media&#x26;token=2571cf1b-74ca-4f42-b911-631c2344b9f5" alt=""><figcaption></figcaption></figure>

You may copy many settings of UI Components or Action nodes as well. For example, you may copy a text or a function from the UI Component [Text](https://docs.appfarm.io/library/ui-components/text), and paste it on any other setting that has the same type of input data type. *In the example below, the Text setting expects a string input. The same goes for the Tooltip setting.*

<figure><img src="https://29237295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiLU-xcHu0eLZiTxcmZ%2Fuploads%2FJ3pr7capEnTcs0amynQp%2Fimage.png?alt=media&#x26;token=1f0e90b9-aff6-4791-a218-3bebc0479199" alt=""><figcaption><p>Copy a setting</p></figcaption></figure>

<figure><img src="https://29237295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiLU-xcHu0eLZiTxcmZ%2Fuploads%2FDgNbRNYGqWHWyzht3BPs%2Fimage.png?alt=media&#x26;token=5ca131db-138e-4329-af96-f89c89be3808" alt=""><figcaption><p>Paste a setting</p></figcaption></figure>

## Things you may copy or cut

This is a non-exhaustive list of components and settings you may copy, duplicate and/or cut in Appfarm Create:&#x20;

**Copy, Cut and Duplicate**

* View/Dialog/Drawer
* UI Component
* App Variable, Runtime Property (in Apps and Services)
* Action (in Apps and Services)
* Object Class and Enum
* Theme

**Copy and Duplicate**

* App
* Service
* Conditional Style

**Copy**

* Most settings, including conditions and functions, both on UI Components or Action Nodes
* Object Class Permissions

**Duplicate**

* Data Source
* Service Endpoint

You may copy between solutions as well. Please see the section on Restrictions and limitations below.

Here are a few examples of some of the hidden gems. The first example is exceptionally useful: Having a large Condition (or Function), you may copy it to another UI Component, or the If Action Node. You may also copy and paste the condition, and then use a [value processor](https://docs.appfarm.io/reference/platform-concepts/value-processor) to invert the whole expression.

<figure><img src="https://29237295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiLU-xcHu0eLZiTxcmZ%2Fuploads%2FxE3y8mWAvk6L2z45iISs%2Fimage.png?alt=media&#x26;token=257b0031-97e6-4451-8a3d-a0a35e813a33" alt=""><figcaption><p>Copy a condition. Paste it somewhere else (and maybe use a value processor to invert it?)</p></figcaption></figure>

<figure><img src="https://29237295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiLU-xcHu0eLZiTxcmZ%2Fuploads%2FcB5saqmjuAExTmxE0Cx4%2Fimage.png?alt=media&#x26;token=8c47b1bd-4e7c-4868-b8f4-deaaf75cc050" alt=""><figcaption><p>Example: Copy Object Class Permissions, from the selected Object Class in the Global Data Model</p></figcaption></figure>

<figure><img src="https://29237295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiLU-xcHu0eLZiTxcmZ%2Fuploads%2FeQKpQGDdfmMQUQMX8iCc%2Fimage.png?alt=media&#x26;token=18096e0e-c4e1-4c2f-acba-2a156d2edf6b" alt=""><figcaption><p>Copy Permissions, from the Permissions meny</p></figcaption></figure>

<figure><img src="https://29237295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiLU-xcHu0eLZiTxcmZ%2Fuploads%2FvFoWF1zp8zknEm9shA0L%2Fimage.png?alt=media&#x26;token=858d8cf5-8be3-4ec6-93cd-40830af4575e" alt=""><figcaption><p>Copy value mappings in a Update Object</p></figcaption></figure>

<figure><img src="https://29237295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiLU-xcHu0eLZiTxcmZ%2Fuploads%2FbpeiK190iwiz5KKtME09%2Fimage.png?alt=media&#x26;token=a27fe1f2-4ada-4a86-b90e-70025e6ff205" alt=""><figcaption><p>Paste value mappings. May be pasted to any Update Object or Create Object towards the same object class type.</p></figcaption></figure>

<figure><img src="https://29237295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiLU-xcHu0eLZiTxcmZ%2Fuploads%2FMmBspu8hGN1d1xyRyUFw%2Fimage.png?alt=media&#x26;token=e12494a4-6186-4e45-9bb9-339fbbcfe648" alt=""><figcaption><p>Copy a Conditional Style</p></figcaption></figure>

<figure><img src="https://29237295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MiLU-xcHu0eLZiTxcmZ%2Fuploads%2FOi4lGgCcnqiLEldic7lM%2Fimage.png?alt=media&#x26;token=d59d6fe0-b4a9-444b-892d-3adc09d89326" alt=""><figcaption><p>Paste the Conditional Style somewhere else</p></figcaption></figure>

## Copy between solutions

You may copy a whole (single) App to the clipboard in Solution 1, and paste it into Solution 2. *Everything is copied, except Permissions and Resource Files. Permissions need to be manually set up in Solution 2, and resource files must be uploaded manually to Solution 2 (download from 1, batch-upload to 2)*

When an App is copied from one solution to another, the Theme and Object Classes (and Enums) used by that App are copied as well. You may *not* merge these copied Object Classes with existing object classes:

* In case you have a `Company` object already in solution B, and the copied app generated a `Customer` object class and you would like them merged: You must use [Find References](https://docs.appfarm.io/reference/appfarm-create/find-references) on the `Customer` object class, and change all references to use the `Company` object class instead.
* If you want to copy 2 Apps from solution A to B (or 1 App and 1 Service), you may currently *not* bundle them together in a single copy operation (2 copy operations will create duplicate object classes)

If you need to copy more than 1 App, Appfarm has the power to copy a whole solution. In this case, you must contact Appfarm. Appfarm will create a snapshot of Solution A, and send it to Solution B. Appfarm will need owner/maintainer access to both solution A and B to perform this cross-solution snapshot. You will then be able to apply that snapshot to Solution B from the Deploy menu. *Note that applying this snapshot to Solution B will overwrite everything in Solution B.*

## Restrictions and limitations

There are certain limitations when copying something from inside one App to another App or Service (in the same solution, or in another solution).

* Copy/Paste inside the same App or Service: Everything is copied.&#x20;
* Copy from inside one App or Service to inside another App or Service (in the same solution, or another solution): *All data bindings are removed*, including functions with function parameters. All bindings to data sources are removed when you try to paste it into another App. For example: A group of UI Components, with a table listing all Projects: When copying this from App 1 to App 2, the data binding of that table is removed. The table is preserved, but you must connect it to a data source in App 2. The reason is that the Apps do not share the data sources.
