# Help export customer data

**URL:** <https://forum.sambapos.com/t/help-export-customer-data/14853>\
**Category:** V5 Question\
**Created:** [May 16, 2017, 7:57pm UTC](https://forum.sambapos.com/t/help-export-customer-data/14853 "2017-05-16T19:57:37Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhayatlah](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/m/4af34b/32.png) [@mhayatlah](https://forum.sambapos.com/u/mhayatlah)\
**Post date:** [May 16, 2017, 7:57pm UTC](https://forum.sambapos.com/t/help-export-customer-data/14853/1 "2017-05-16T19:57:37Z")

</div>

hello all,

I am trying to export the customer data using MS management studio.

I have a litl experience with SQL query

this is the culomn data

[{“Name”:“PostCode”,“Value”:“BS3 1JQ”},{“Name”:“House Number”,“Value”:“169”},{“Name”:“Street”,“Value”:“North Street”},{“Name”:“Town”,“Value”:“Bristol”},{“Name”:“County”,“Value”:“City of Bristol”},{“Name”:“Distance”,“Value”:“0.383125”},{“Name”:“Name”,“Value”:null}]

and this is the select ststmant i use

> SELECT EntityTypeId, Entities.CustomData  
> FROM Entities  
> WHERE EntityTypeId = ‘1’

how i can column like this

PostCode : House Number : Street : Town :

BS3 1JQ 169 NNN Bristol

Kind regards,  
Mohammed

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [May 16, 2017, 8:16pm UTC](https://forum.sambapos.com/t/help-export-customer-data/14853/2 "2017-05-16T20:16:15Z")

</div>

Export to what?  
Thats JSON and until 2016 SQL has limited/no JSON abilities.

If you explain what your doing it would help.

---

<div class="post-metadata">

**Author:** ![mhayatlah](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/m/4af34b/32.png) [@mhayatlah](https://forum.sambapos.com/u/mhayatlah)\
**Post date:** [May 17, 2017, 1:15am UTC](https://forum.sambapos.com/t/help-export-customer-data/14853/3 "2017-05-17T01:15:20Z")

</div>

to MS Excel but first, I have to write the correct select statement.

I am old now 🙂 and been more than 10 years I did not do any programming or coding, I am a chef now:slight\_smile:  
I just need t know how to do select statement can read this data from Entities.CustomData  
maybe I can refresh my brain.

please have a look to the print screen

 ![](https://forum.sambapos.com/uploads/default/original/3X/6/3/63e6ac59a24b075c457368750347e495d511aa16.png)

---

<div class="post-metadata">

**Author:** ![mhayatlah](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/m/4af34b/32.png) [@mhayatlah](https://forum.sambapos.com/u/mhayatlah)\
**Post date:** [May 17, 2017, 1:21am UTC](https://forum.sambapos.com/t/help-export-customer-data/14853/4 "2017-05-17T01:21:25Z")

</div>

usually, as I remember every column store a value in this case Entities.CustomData store many data, this is new to me so I forgot how to read this using select

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [May 17, 2017, 6:10am UTC](https://forum.sambapos.com/t/help-export-customer-data/14853/5 "2017-05-17T06:10:11Z")

</div>

As I said that’s JSON which SQL pre 2016 doesn’t have much power to manipulate.  
It is used because the entity custom fields are not fixed field content, similar to custom product tags.this is not unusual especially in world of web with php and Java.

You will be better off using the samba reports and data export option to output to CSV which you’ll be able to open in excel.

The report wouldn’t be overly complex…  
{REPORT ENTITY DETAILS:xxxxxxxxx} will do the job.  
I have one very similar to get a list of emails for mail list for last client but not at PC.

---

<div class="post-metadata">

**Author:** ![mhayatlah](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/m/4af34b/32.png) [@mhayatlah](https://forum.sambapos.com/u/mhayatlah)\
**Post date:** [May 17, 2017, 6:58am UTC](https://forum.sambapos.com/t/help-export-customer-data/14853/6 "2017-05-17T06:58:04Z")

</div>

any tutorial in one page with exact steps because in the forum it’s confusing

---

<div class="post-metadata">

**Author:** ![mhayatlah](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/m/4af34b/32.png) [@mhayatlah](https://forum.sambapos.com/u/mhayatlah)\
**Post date:** [May 17, 2017, 7:04am UTC](https://forum.sambapos.com/t/help-export-customer-data/14853/7 "2017-05-17T07:04:29Z")

</div>

there is no much can do in MS management studio for this

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [May 17, 2017, 8:07am UTC](https://forum.sambapos.com/t/help-export-customer-data/14853/8 "2017-05-17T08:07:57Z")

</div>

It’s not that confusing, third result for search of ‘export entity data’

> [@Export custom data into csv or txt](https://forum.sambapos.com/t/export-custom-data-into-csv-or-txt/13406/4):
>
> Youll need to add a constraint expression to entity type etc to set to only be one type of entity. As for output how do you mean fkd? are you setting the export directory as a .csv file?

---

<div class="post-metadata">

**Author:** ![mhayatlah](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/m/4af34b/32.png) [@mhayatlah](https://forum.sambapos.com/u/mhayatlah)\
**Post date:** [May 23, 2017, 11:14pm UTC](https://forum.sambapos.com/t/help-export-customer-data/14853/9 "2017-05-23T23:14:34Z")

</div>

after an update the excel file and the data how I can import it back to samba

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [May 23, 2017, 11:21pm UTC](https://forum.sambapos.com/t/help-export-customer-data/14853/10 "2017-05-23T23:21:35Z")

</div>

> [@SambaPOS 5 Bulk Product and Inventory Importer](https://forum.sambapos.com/t/sambapos-5-bulk-product-and-inventory-importer/10809):
>
> ##Synopsis This Tool is primarily used as a Bulk Product, Inventory, and Recipe importer based on data read from a CSV file. This is especially useful in Retail applications where there is a direct 1:1 relationship between Items you buy from a supplier and Products you sell. As of this release, this Tool is compatible with the following SambaPOS versions: 5.1.58 - 5.1.60 (DB version 124) ::: [dbops124c.zip](https://forum.sambapos.com/uploads/default/original/3X/d/1/d15e79bb9e88db8c2941bcaaa7c471988b6b466c.zip) (24.6 KB) Originally developed by @JohnS for SambaPOS 3, updates to the Tool were dev…

> [@Excel file to sambapos](https://forum.sambapos.com/t/excel-file-to-sambapos/9436/19):
>
> Search the 'net to find tools to convert CSV to YAML. Or use Excel to read the CSV data and use this formula in a Cell: =CONCATENATE("- Name: ", A2, CHAR(10), " GroupCode: ", "Imported", CHAR(10), " Barcode: ", C2, CHAR(10), " Portions: ", CHAR(10), " - Name: Normal", CHAR(10), " Price: ", G2) That produces YAML formatted data from your CSV file. Copy the formula to every row. warning You will probably want to clean up your CSV data file. There are duplicate Products, and some wi…

---

<div class="post-metadata">

**Author:** ![mhayatlah](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/m/4af34b/32.png) [@mhayatlah](https://forum.sambapos.com/u/mhayatlah)\
**Post date:** [May 24, 2017, 3:20am UTC](https://forum.sambapos.com/t/help-export-customer-data/14853/11 "2017-05-24T03:20:06Z")

</div>

I read the both link, I couldn’t understand or do it for customer details. would u please explain to me or would u please send me some steps to do

regards

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [May 24, 2017, 10:31am UTC](https://forum.sambapos.com/t/help-export-customer-data/14853/12 "2017-05-24T10:31:55Z")

</div>

There was another post the other day where someone was creating a yaml string using a formula in excel, did you see that?

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [May 24, 2017, 3:27pm UTC](https://forum.sambapos.com/t/help-export-customer-data/14853/13 "2017-05-24T15:27:31Z")

</div>

> [@mhayatlah](#):
>
> would u please explain to me or would u please send me some steps to do

The steps are detailed in the links I provided. There is no need to re-iterate them here.

> [@JTRTech](#):
>
> There was another post the other day where someone was creating a yaml string using a formula in excel,

That is shown in the the 2nd link.

---

<div class="post-metadata">

**Author:** ![mhayatlah](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/m/4af34b/32.png) [@mhayatlah](https://forum.sambapos.com/u/mhayatlah)\
**Post date:** [May 30, 2017, 1:19am UTC](https://forum.sambapos.com/t/help-export-customer-data/14853/14 "2017-05-30T01:19:16Z")

</div>

Dear ALL,

many thanks to all for the efforts I made I learned a lot from you.  
I successfully export the customer details to excel files please have a look to the report and to the Excel file below

 ![](https://forum.sambapos.com/uploads/default/original/3X/4/f/4f7e85cedef0a12d100ec32a11d40c02bcb21fd6.png)

 ![](https://forum.sambapos.com/uploads/default/original/3X/0/0/00d5fc5d5f51194fc2ee70495e22b87552e7d2d4.png)

 ![](https://forum.sambapos.com/uploads/default/original/3X/8/e/8e1258937d4271f2b6b6e62ebb218b279065fdc1.png)

now in excel I have clean the data and fix the everything, I can now send the SMS to customers and run some more marketing.

now I would like to import the clean data bake to samba or sync the data whatever you call, @QMcKay advised me to use batch create after creating a yaml string using a formula in excel,

I had followed all steps as in the below pic

 ![](https://forum.sambapos.com/uploads/default/original/3X/9/5/954de84bc7d7237d889611aa03f09ffd2e95bd31.png)

 ![](https://forum.sambapos.com/uploads/default/original/3X/6/3/637ebc63d6534967aae75965db31c97dfbd56253.png)

when I use this formula in Excel

 ![](https://forum.sambapos.com/uploads/default/original/3X/2/d/2d106c16b16a91b7b4694439318d6afb4243afcf.png)

I used the batch create

 ![](https://forum.sambapos.com/uploads/default/original/3X/a/1/a171a430f0d75d2db2acffe4d5e83a6a98af664b.png)

 ![](https://forum.sambapos.com/uploads/default/original/3X/4/6/467d3b0ef73fe3da08bf9b70093dac1782993a11.png)

i am not sure what is the prob
