# Setting up Import from Mobile Application

**URL:** <https://forum.xeelo.com/t/setting-up-import-from-mobile-application/476>\
**Category:** Mobile\
**Tags:** import, subgrid, mobile, mobileapp\
**Created:** [June 15, 2018, 8:41am UTC](https://forum.xeelo.com/t/setting-up-import-from-mobile-application/476 "2018-06-15T08:41:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev.olomouc](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xeelo.com/dev.olomouc/32/697_2.png) [@dev.olomouc](https://forum.xeelo.com/u/dev.olomouc)\
**Post date:** [June 15, 2018, 8:41am UTC](https://forum.xeelo.com/t/setting-up-import-from-mobile-application/476/1 "2018-06-15T08:41:32Z")

</div>

### Overview

We’ll setup a single object, which will be available for mobile clients. Saving request from Mobile application depends on Import framework, which adds a possibility to import data from mobile object to completely different object, but for simplicity, we’ll work with single object.

### Create Object and Sub-grid

We will create Object called **Car Incident** consisting of **Incident ID** (text unique on object level with autonumber) and **Description** (mandatory multi-line text) and will be able to attach photos of his car. For attachments we’ll use Sub-grid called **Car Incident Images**. Such sub-grid will again contain unique autonumber text line called **Image ID** with mandatory **Image** attachment.

 ![Car_Incident_object](https://canada1.discourse-cdn.com/flex027/uploads/xeelo/original/2X/d/d0b5393cab5c8f97bb8b2b9e070f82c89110328e.png)

 ![Car_Incident_subgrid](https://canada1.discourse-cdn.com/flex027/uploads/xeelo/original/2X/c/c4efc4675519a8ae5e28bd47c4eee8ca2835b8a7.png)

### Create Object Template

We’ll create a default object template. Under **Access & Visibility** tile we go to **External** tab and setup Object line visibility for Mobile Device. When creating a template, we need to assign **Workflow** , I used dummy, single step workflow, containing workflow status with **Visible Mobile** enabled. Requests in such status will appear in mobile application among **My Tasks**.

> It’s absolutely necessary to add subgrid template line for subgrid!

### Create Import

Creating/Updating requests using mobile visible object is achieved using Import framework. Admin has a possibility to import from **Car Incident** to completely different object, but we’re going to import into **Car Incident**. So, let’s create **Car Incident Import** importing to **Car Incident** object. We enable **Create New** checkbox, so we’ll be able to create request, and also enable **Update** checkbox so we’ll be able to update existing requests.

Our import must contain 2 Import Sections. One is type of **Request** and second one’s type is going to be **Sub-grid**. We need to put Import Section Lines we want to import into both sections.

 ![Car_Incident_import_sections](https://canada1.discourse-cdn.com/flex027/uploads/xeelo/original/2X/f/fb1ed61e3d392f6af8273bc83672ab6d083b11a4.png)

 ![Car_Incident_import_subgrid_section](https://canada1.discourse-cdn.com/flex027/uploads/xeelo/original/2X/9/95a2e3a917763234b1145e7a67ff4bfdb8be2915.png)

_ **NOTE:** _ Some Import Section Lines already existed once we created Sections. Those lines are **mandatory** in order to make the import work. Note that, for sub-grid section there is **Incident ID** line from object. This line is required, so the request can be determined at import time.

### Assign Import

Now, we’re almost done. We need to tell the source object how to use our import. Let’s return back to **Car Incident** object and open it’s default template. We check **Allowed** flag in the Mobile import section and select our **Car Incident Import**. Once saved, requests, created/updated via mobile application will use **Car Incident Import**. And now the last crucial step. Suddenly **Import Mapping** tile becomes available.

 ![Car_Incident_template](https://canada1.discourse-cdn.com/flex027/uploads/xeelo/original/2X/6/615932faaef0bb83ed88306be6e94c2c57271cdd.png)

#### Setup Import Mapping

On import mapping, we have to define relation between source object lines (from **Car Incident** object) and target import section lines of **Car Incident Import** import. We’ll basically map Object Lines one to one, with an important exception. We **have to** map **Incident ID** line twice. First mapping is required for **Request** section, the other for **Sub-grid** section.

_ **NOTE:** _ For simplicity, we’'ve set single object/sub-grid line as unique. In case you need to have multiple lines as unique, you must set mapping for **all** of them both for request and sub-grid import sections.

 ![Car_Incident_import_mapping](https://canada1.discourse-cdn.com/flex027/uploads/xeelo/original/2X/3/36dfd82750bae4f63debf76fbc6c73cc7fd674a7.jpg)

### Finished

We’re done. You can download [ObjectSetup\_20180620\_223901.zip](https://forum.xeelo.com/uploads/short-url/UPRtgDOOQKUlTNWEZ5OBDx7pdT.zip) (9.64 KB) and try it on your own.

---

<div class="post-metadata">

**Author:** ![dev.olomouc](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xeelo.com/dev.olomouc/32/697_2.png) [@dev.olomouc](https://forum.xeelo.com/u/dev.olomouc)\
**Post date:** [June 20, 2018, 8:37pm UTC](https://forum.xeelo.com/t/setting-up-import-from-mobile-application/476/3 "2018-06-20T20:37:33Z")

</div>


