# Cannot do the mapping during import?

**URL:** <https://the.fmsoup.org/t/cannot-do-the-mapping-during-import/280>\
**Category:** Questions\
**Created:** [August 16, 2019, 10:25am UTC](https://the.fmsoup.org/t/cannot-do-the-mapping-during-import/280 "2019-08-16T10:25:34Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![samfmp](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@samfmp](https://the.fmsoup.org/u/samfmp)\
**Post date:** [August 16, 2019, 10:25am UTC](https://the.fmsoup.org/t/cannot-do-the-mapping-during-import/280/1 "2019-08-16T10:25:34Z")

</div>

Hi, I have posted a question in community, but I would like to see if anyone could help me here.

I could not do the mapping between 2 tables. There are 33 fields in table A and 37 fields in table B so I would like to update the record in A using table B(source file) if there are no matching records, a new one will be created in table A. The problem is some fields cannot be matched.

Also, there are another problems, sometimes the default source table is changed to table C so I cannot do the mapping. I have to do it manually.

Does anyone could help me? I have tried FM17 and 18 without success.

If it is not ok to post here. I will delete this post.

---

<div class="post-metadata">

**Author:** ![anon45965781](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@anon45965781](https://the.fmsoup.org/u/anon45965781)\
**Post date:** [August 16, 2019, 10:58am UTC](https://the.fmsoup.org/t/cannot-do-the-mapping-during-import/280/2 "2019-08-16T10:58:28Z")

</div>

Welcome to the forum!

What do you mean you can’t do the “mapping”?

Do you have a primary key/foreign key relationship set up?

How are you trying to do the update? A script?

Please post an image of the relevant part of your relationship graph and also your script.

You could still do this UPDATE using SQL, but not within FileMaker itself - but still using FileMaker and it’s JDBC driver.

---

<div class="post-metadata">

**Author:** ![Torsten](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/torsten/32/1574_2.png) [@Torsten](https://the.fmsoup.org/u/Torsten)\
**Post date:** [August 16, 2019, 12:14pm UTC](https://the.fmsoup.org/t/cannot-do-the-mapping-during-import/280/3 "2019-08-16T12:14:40Z")

</div>

Hi @samfmp,

@anon45965781 asked good questions. Providing a sample file with some sample records in table A and B would help a lot figuring out how this can be fixed.

---

<div class="post-metadata">

**Author:** ![Cecile](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/cecile/32/98_2.png) [@Cecile](https://the.fmsoup.org/u/Cecile)\
**Post date:** [August 16, 2019, 1:05pm UTC](https://the.fmsoup.org/t/cannot-do-the-mapping-during-import/280/4 "2019-08-16T13:05:06Z")

</div>

Are some of the fields that can’t be mapped calculation fields by any chance?

---

<div class="post-metadata">

**Author:** ![samfmp](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@samfmp](https://the.fmsoup.org/u/samfmp)\
**Post date:** [August 16, 2019, 2:18pm UTC](https://the.fmsoup.org/t/cannot-do-the-mapping-during-import/280/5 "2019-08-16T14:18:08Z")

</div>

Thank you. The situation is like this sample file[FieldMapping.fmp12](https://the.fmsoup.org/uploads/short-url/3skQPgOYgsR9J70o5ux3yGYPHbJ.fmp12) (216 KB)

![26](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/1X/2edce80821db1fb9caea9692167c577c2eede44e.jpeg)  
so the expected mapping is like this.

![53](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/1X/cb781a3d8eeed5935aad0a13479f4eb079fd5559.jpeg)  
When I press the button again, it will change the source to table 1.

![10](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/1X/2c2e5e48a88cffd1be3bb784c99c19f2ecdbc9b3.jpeg)  
When I changed back to table 2, the mapping is broken.

so I could not do it automatically.

---

<div class="post-metadata">

**Author:** ![AndyHibbs](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/andyhibbs/32/3089_2.png) [@AndyHibbs](https://the.fmsoup.org/u/AndyHibbs)\
**Post date:** [August 16, 2019, 2:40pm UTC](https://the.fmsoup.org/t/cannot-do-the-mapping-during-import/280/6 "2019-08-16T14:40:57Z")

</div>

I haven’t looked at your demo file, but it looks as if you are trying to import from and to the same table occurrence within the same file, or are you importing from a separate file?

You can import from the same table into the same table, but you’d need to do it from a separate table occurrence within your relationship graph.

Again, above having only taken a cursory glance at the screen images.

---

<div class="post-metadata">

**Author:** ![AndyHibbs](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/andyhibbs/32/3089_2.png) [@AndyHibbs](https://the.fmsoup.org/u/AndyHibbs)\
**Post date:** [August 16, 2019, 2:42pm UTC](https://the.fmsoup.org/t/cannot-do-the-mapping-during-import/280/7 "2019-08-16T14:42:48Z")

</div>

Ah, should have looked at your file first. You can’t import into calculation fields

---

<div class="post-metadata">

**Author:** ![samfmp](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@samfmp](https://the.fmsoup.org/u/samfmp)\
**Post date:** [August 16, 2019, 2:47pm UTC](https://the.fmsoup.org/t/cannot-do-the-mapping-during-import/280/8 "2019-08-16T14:47:33Z")

</div>

No, just importing record from Test2 to Test1. And there is a calculation for other purposes, and I would like to import from e to c.

However, I could not save the mapping in the hosted file.

---

<div class="post-metadata">

**Author:** ![AndyHibbs](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/andyhibbs/32/3089_2.png) [@AndyHibbs](https://the.fmsoup.org/u/AndyHibbs)\
**Post date:** [August 16, 2019, 2:53pm UTC](https://the.fmsoup.org/t/cannot-do-the-mapping-during-import/280/9 "2019-08-16T14:53:59Z")

</div>

We always script any form of import. Even if we’re doing data work in a development environment, it doesn’t matter how many times we think we’re only going to import a specific mapping, we always seem to need to do it again at some point.

Hence, I’d recommend creating a single line script using the Import Records script step, set the mapping up in it, which should be retained. If you’re doing other imports, then set up scripts for them as well.

---

<div class="post-metadata">

**Author:** ![Torsten](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/torsten/32/1574_2.png) [@Torsten](https://the.fmsoup.org/u/Torsten)\
**Post date:** [August 16, 2019, 4:03pm UTC](https://the.fmsoup.org/t/cannot-do-the-mapping-during-import/280/10 "2019-08-16T16:03:54Z")

</div>

My experience and practice of importing matches Andy’s.

---

<div class="post-metadata">

**Author:** ![Torsten](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/torsten/32/1574_2.png) [@Torsten](https://the.fmsoup.org/u/Torsten)\
**Post date:** [August 17, 2019, 5:33am UTC](https://the.fmsoup.org/t/cannot-do-the-mapping-during-import/280/11 "2019-08-17T05:33:56Z")

</div>

Hi @samfmp  
Just tested the file you provided. Importing from table2 into table1 works fine. As @AndyHibbs and @Cecile mentioned, calculated fields cannot be targets of import, as you cannot edit their content.

If this did not solve your problem, please provide a set-by-step-description of your import task, source and target with true field names for a more detailed look into the issue.

---

<div class="post-metadata">

**Author:** ![samfmp](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@samfmp](https://the.fmsoup.org/u/samfmp)\
**Post date:** [August 19, 2019, 6:32am UTC](https://the.fmsoup.org/t/cannot-do-the-mapping-during-import/280/13 "2019-08-19T06:32:28Z")

</div>

It seems that I have figured out the reason.

Firstly I have to use the filename as the path, but not a variable, e.g. file: XXX.fmp12  
Then, I could set up the field mapping of importing.  
Finally, I could switch to the variable path.

---

<div class="post-metadata">

**Author:** ![samfmp](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@samfmp](https://the.fmsoup.org/u/samfmp)\
**Post date:** [August 20, 2019, 9:05am UTC](https://the.fmsoup.org/t/cannot-do-the-mapping-during-import/280/14 "2019-08-20T09:05:25Z")

</div>

I have similar problem again. How could I save the mapping for data source as variables with temporary path?😢

---

<div class="post-metadata">

**Author:** ![anon45965781](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@anon45965781](https://the.fmsoup.org/u/anon45965781)\
**Post date:** [August 20, 2019, 10:26am UTC](https://the.fmsoup.org/t/cannot-do-the-mapping-during-import/280/15 "2019-08-20T10:26:13Z")

</div>

If you have the same import, again, a JDBC program could be all you need.

Unfortunately, FMP does not try to infer data types during imports as, say, the free MySQL does, but with a simple JDBC prograrm, you’ve already got those mapped.

---

<div class="post-metadata">

**Author:** ![AndyHibbs](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/andyhibbs/32/3089_2.png) [@AndyHibbs](https://the.fmsoup.org/u/AndyHibbs)\
**Post date:** [August 20, 2019, 3:27pm UTC](https://the.fmsoup.org/t/cannot-do-the-mapping-during-import/280/16 "2019-08-20T15:27:18Z")

</div>

From memory, I’ve set the import field mapping using the file name (in a script) and then later on substituted the file name for a variable.

If the variable is empty, then FileMaker can’t access the file or field names to map.

---

<div class="post-metadata">

**Author:** ![jormond](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@jormond](https://the.fmsoup.org/u/jormond)\
**Post date:** [August 20, 2019, 6:10pm UTC](https://the.fmsoup.org/t/cannot-do-the-mapping-during-import/280/17 "2019-08-20T18:10:36Z")

</div>

Enter the list of paths like below, FileMaker will evaluate them in order, until it finds a successful one.

```
$path
file:/Users/myUserName/Documents/sampleFile.csv
```

---

<div class="post-metadata">

**Author:** ![samfmp](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@samfmp](https://the.fmsoup.org/u/samfmp)\
**Post date:** [August 21, 2019, 7:46am UTC](https://the.fmsoup.org/t/cannot-do-the-mapping-during-import/280/18 "2019-08-21T07:46:00Z")

</div>

Thank all again. I guess the problem may be due to the character set of the data, the data I have used is UTF-8 while the setting of importing records is other character set so I cannot import data to the table.
