# Translation Manager Insert Bulk record

**URL:** <https://forum.inductiveautomation.com/t/translation-manager-insert-bulk-record/60944>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [June 20, 2022, 8:05am UTC](https://forum.inductiveautomation.com/t/translation-manager-insert-bulk-record/60944 "2022-06-20T08:05:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [June 20, 2022, 8:05am UTC](https://forum.inductiveautomation.com/t/translation-manager-insert-bulk-record/60944/1 "2022-06-20T08:05:27Z")

</div>

Hi,

i am using message handler to insert data in to Translation manager in different gateways

```auto
def handleMessage(payload):

	English_lang = payload['English']
	Translate_lang = payload['Translated_lang']
	Lang_code = payload['Language_code']
	
	system.util.modifyTranslation(English_lang,Translate_lang,Lang_code)

```

But i want to do **bulk insert using excel file.**  
How to pass the **excel file in payload** and insert the record in translation manager for different gateways at same time?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [June 20, 2022, 11:40am UTC](https://forum.inductiveautomation.com/t/translation-manager-insert-bulk-record/60944/2 "2022-06-20T11:40:13Z")

</div>

> [@prasath.t](#):
>
> How to pass the **excel file in payload**

Don't, you'll run into headaches. Instead, parse the file in whatever event where you are accessing it, and build some type of data structure to send as the payload.

For instance I would be tempted to build a dictionary where the `English` is the key.

```auto
payload = {'Translations':{'English 1':{'Translated_lang':'translated lang','Language_code':'language code'},'English 2':{'Translaged_lang':'translaged lang','Language_code':'language code'}}}

```

then loop through that in your message handler:

```auto
def handleMessage(payload):

    translations = payload['Translations']

    for english,vals in translations.iteritems():
        system.util.modifyTranslation(english,vals['Translated_lang'],vals['Language_code'])

```

Note: Depending on how many of these you need to do, you may need to consider breaking the file into manageable chunks.

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [June 20, 2022, 12:00pm UTC](https://forum.inductiveautomation.com/t/translation-manager-insert-bulk-record/60944/3 "2022-06-20T12:00:46Z")

</div>

> [@lrose](#):
>
> `payload = {'Translations':{'English 1':{'Translated_lang':'translated lang','Language_code':'language code'},'English 2':{'Translaged_lang':'translaged lang','Language_code':'language code'}}}`

Its very confusing for me how your dictionary works

for exmple

```auto
english french language code
Helo Hélo fr
read lis fr
write écrivez fr

```

Can you please take this as example and build your dictionary for this one

It will help full for me to understand

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [June 20, 2022, 12:16pm UTC](https://forum.inductiveautomation.com/t/translation-manager-insert-bulk-record/60944/4 "2022-06-20T12:16:39Z")

</div>

I would use a list of dictionaries.

```python
payload = {'data' : [{'keyIn':'Hello', 'Translated_lang':'Hélo', 'Language_code':'fr'},
					 {'keyIn':'read', 'Translated_lang':'lis', 'Language_code':'fr'},
					 {'keyIn':'write', 'Translated_lang':'écrivez', 'Language_code':'fr'},
					]
		  }
		  
for row in payload['data']:
	system.util.modifyTranslation(row['keyIn'], row['Translated_lang'], row['Language_code'])

```

I know we usually say English for the key, but the key can really be anything.

---

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [June 20, 2022, 5:42pm UTC](https://forum.inductiveautomation.com/t/translation-manager-insert-bulk-record/60944/5 "2022-06-20T17:42:22Z")

</div>

One question… If front end user wants to add records to translation manager.

Is there any alternative way to do it?

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [June 21, 2022, 5:44pm UTC](https://forum.inductiveautomation.com/t/translation-manager-insert-bulk-record/60944/6 "2022-06-21T17:44:44Z")

</div>

That scripting function also works in the client if users have the [Translation Management permission](https://docs.inductiveautomation.com/display/DOC81/Vision+Project+Properties#VisionProjectProperties-VisionPermissionsProperties).
