أي أحد اشتغل في المبيعات أو خدمة العملاء عنده هالملف. إكسل فيه كم ألف رقم، كل عمود مسمّى على كيف اللي سوّاه، نصه عربي ونصه إنجليزي، وفيه عمود اسمه «كود» محد يتذكر وش هو. ترفعه على أي نظام وأول شي يطلع لك سؤال: هذا العمود وش هو؟ وتقعد تطابق عمود عمود.
Anyone who's worked in sales or support has this file. An Excel sheet with a few thousand numbers, every column named however the person who made it liked, half Arabic and half English, and one column called “Code” that nobody remembers. You upload it somewhere and the first thing you get is a question: what's this column? Then you sit there matching them one at a time.
وهنا بالذات كثير من الناس يوقفون. يرفعون الملف، تطلع شاشة المطابقة، ويسكّرونها. فخلّينا الذكاء الاصطناعي يسوي المطابقة عنك. بس قبل ما يوصل له شي، فيه شغل كثير يصير بدونه، وهذا اللي بنشرحه هنا.
That's the step where a lot of people give up. They upload the file, hit the mapping screen, and close it. So now AI does the matching for you. But a lot happens before the model gets involved, and that's what this post is about.
ملف واحد، من أوله لآخرهOne file, start to finish
| 1 | رقم الجوّال | الاسم | الإيميل | المدينة | حالة العميل | تاريخ التسجيل | جوال ثاني | الحي | ملاحظات المندوب | كود |
|---|---|---|---|---|---|---|---|---|---|---|
| 2 | 0551234567+96655123456705 | سارة الدوسري | sara.d@mail.sa | الرياض | مهتم | 2026-01-14 | النرجس | يبي عرض سعر | A-104 | |
| 3 | ٠٥٠٢٢٢٣٣٤٤+96650222334405 | فهد الشمري | جدة | جديد | 2026-02-03 | 0540001122 | الروضة | كلمه بعد العصر | B-311 | |
| 4 | 551234567+966551234567بدون 0مكررduplicate | سارة الدوسري | الرياض | مهتم | 2026-01-14 | النرجس | A-104 | |||
| 5 | 5.04411223E+08+966504411223علمي | نورة العتيبي | noura@mail.sa | الخبر | تم البيع | 2026-03-21 | العليا | مهتم بالباقة السنوية | C-062 | |
| 6 | فاضيblank | عبدالله القحطاني | أبها | غير مهتم | 2026-04-02 | المنهل | ما رد | X-093 | ||
| 7 | 00966 55 765 4321+96655765432100 | ريم الحربي | reem.h@mail.sa | الدمام | مهتم | 2026-05-18 | 0569998877 | الشاطئ | طلب يتواصل واتساب | Z-027 |
| 8 | +966 (53) 100-2030+966531002030+ | خالد الغامدي | مكة | جديد | 2026-06-09 | العزيزية | B-415 | |||
| 9 | 966557654321+966557654321966مكررduplicate | ريم الحربي | الدمام | مهتم | 2026-05-18 | الشاطئ | Z-027 | |||
| و1,332 صف ثاني تحت…and 1,332 more rows below… | ||||||||||
هذا ملف تجريبي فيه 1,340 صف وعشرة أعمدة، كل واحد مسمّى على كيف اللي سوّاه. بنمشي فيه خطوة خطوة.
This is a sample file with 1,340 rows and ten columns, each named however its author liked. Let's walk through it, one step at a time.
أول شي نوحّد شكل العناوين: نشيل التشكيل والمسافات، ونوحّد الهمزات، فـ«رقم الجوّال» و«رقم الجوال» يصيرون نفس الاسم. ثلاثة منها طابقت أسماء نعرفها، فانربطت على طول، بدون أي ذكاء اصطناعي.
First the headers get flattened: diacritics and spaces come out and hamza forms are unified, so “رقم الجوّال” and “رقم الجوال” count as the same name. Three of them match names we know, so they're mapped on the spot, no AI involved.
السبعة الباقية بس تروح للنموذج. من كل عمود: العنوان، وخمس قيم مختلفة بالكثير، وكم قيمة مختلفة فيه. المظلل هو كل اللي يطلع من ملفك.
Only the other seven go to the model. From each: the header, at most five distinct values, and how many distinct values it has. What's highlighted is everything that leaves your file.
يرجع الجواب والسيرفر يفحصه. «الحي» انقال عنه قائمة، بس فيه أكثر من 20 قيمة، فانشال الاقتراح ورجع العمود لك. و«كود» انقال عنه تجاهل.
The answers come back and the server checks them. “الحي” was suggested as a list, but it has more than 20 values, so the suggestion is dropped and the column comes back to you. “كود” was marked ignore.
بعدها الأرقام. سبع صيغ مختلفة، وكلها ترجع بصيغة +966. صفين طلعوا نفس رقم صف قبلهم فما ينضافون مرتين، والصف اللي بدون رقم ما يدخل.
Then the numbers. Seven different formats, all rewritten as +966 numbers. Two rows turn out to be the same number as an earlier row, so they aren't added twice, and the row with no number stays out.
وآخر شي الدفعات. كل دفعة 2,000 صف، فهالملف كله دفعة وحدة. ملف فيه 200 ألف صف يصير 100 دفعة، تشتغل في الخلفية وأنت تكمل شغلك.
Last, batches. Each batch is 2,000 rows, so this whole file is one. A 200,000-row file becomes 100 batches, running in the background while you get on with your day.
أول شي: اللي نعرفه ما نسأل عنهFirst, we don't ask about what we already know
الملف يتقرا في متصفحك، CSV كان أو إكسل. بعدها نمر على عناوين الأعمدة ونقارنها بقائمة أسماء نعرفها لكل حقل: «رقم الجوال» و«الجوال» و«Mobile» للجوال، «الاسم» و«Full Name» للاسم، وكذا للإيميل والشركة والمنصب.
The file is read in your browser, CSV or Excel. Then we go through the column headers and compare them with a list of names we know for each field: “رقم الجوال”, “الجوال” and “Mobile” for phone, “الاسم” and “Full Name” for name, and so on for email, company and position.
المشكلة إن محد يكتب نفس الشي. واحد يكتب «رقم الجوّال» بشدّة، والثاني «رقم الجوال» بمسافتين، والثالث phone_number. فقبل المقارنة نكوي العنوان: نشيل التشكيل والمسافات والشرطات، ونخلي أ وإ وآ كلها ا، والتاء المربوطة هاء. بعدها كلهم يصيرون نفس الكلمة.
The catch is nobody writes it the same way. One person types “رقم الجوّال” with a shadda, another puts two spaces in the middle, a third writes phone_number. So before comparing we flatten the header: diacritics, spaces and dashes come out, the hamza forms of alef become a plain alef, and teh marbuta becomes heh. After that they're all the same word.
والترتيب ثابت: الجوال أول، بعده الاسم، بعدين الخصائص اللي عندك أصلًا في مساحة العمل، وآخر شي الشركة والمنصب والإيميل. يعني لو عندك خاصية اسمها «الاسم»، ما راح تاخذ عمود الاسم الحقيقي.
The order is fixed: phone first, then name, then the custom properties your workspace already has, and company, position and email last. So if you happen to have a property called “Name”, it can't steal the real name column.
في الملف التجريبي فوق، ثلاثة أعمدة انعرفت على طول وما احتجنا أحد. السبعة الباقية هي اللي فعلًا تحتاج أحد يفكّر فيها.
In the sample sheet above, three columns were recognised straight away without anyone's help. The other seven are the ones that actually need some thought.
وش يشوف الذكاء الاصطناعي بالضبط؟What exactly does the AI see?
الأعمدة اللي ما عرفناها، وبس هي، تروح للنموذج. والملف نفسه ما يروح. لكل عمود نرسل ثلاثة أشياء: العنوان، وخمس قيم مختلفة بالكثير، وكم قيمة مختلفة فيه. كل قيمة نقصّها عند 120 حرف، والعدّ يوقف عند 21، لأن بعد الـ20 الرقم بالضبط ما يفرق.
The columns we didn't recognise, and only those, go to the model. The file itself doesn't. For each column we send three things: the header, at most five distinct values, and how many distinct values it has. Each value is cut at 120 characters, and the count stops at 21: past 20, the exact number no longer matters.
يعني لو ملفك فيه خمسين ألف عميل، النموذج يشوف خمس قيم من كل عمود، لحد خمسين عمود. وأعمدة الجوال والاسم اللي عرفناها في الخطوة الأولى ما تطلع أصلًا.
So if your file has fifty thousand customers, the model sees five values per column, for up to fifty columns. The phone and name columns we recognised in the first step never leave at all.
والنموذج يرد لكل عمود بواحد من أربعة: حقل أساسي مثل جوال إضافي أو ملاحظة، أو خاصية عندك من قبل، أو خاصية جديدة يقترح اسمها ونوعها (نص، رقم، تاريخ، قائمة)، أو «تجاهل» إذا ما كان واضح. ومع كل جواب يعطينا قد إيش هو متأكد.
For each column the model answers with one of four things: a built-in field like an extra phone number or a note, a property you already have, a new property with a suggested name and type (text, number, date or list), or “ignore” if it isn't clear. Each answer comes with how confident it is.
بس ما ناخذ كلامه على طول. السيرفر يفحص كل جواب:
But we don't take its word for it. The server checks every answer:
- إذا قال «خاصية موجودة»، لازم تكون موجودة فعلًا في مساحة عملك. ما يقدر يخترع وحدة.
- الحقل الواحد ما ينعطى لعمودين.
- ما يقترح «قائمة» إلا إذا كانت القيم المختلفة 20 أو أقل. عمود «الحي» فيه مية حي؟ لا.
- If it says “existing property”, that property has to really exist in your workspace. It can't make one up.
- One field can't go to two columns.
- It can only suggest a list if the column has 20 distinct values or fewer. A district column with a hundred districts? No.
أي جواب ما يعدّي الفحص ينشال، والعمود يرجع لك تقرر فيه. ولو النموذج تأخر أو تعطّل، ما يوقف شي: تطلع لك رسالة إن الاقتراحات مو متاحة الحين، وتكمل المطابقة بيدك مثل أول.
Any answer that fails a check is dropped, and that column is back in your hands. If the model is slow or down, nothing breaks: you get a note that suggestions aren't available right now, and you map the columns yourself like before.
وأنت آخر واحد يقررAnd you get the final say
الاقتراحات تطلع في شاشة المطابقة وعليها علامة «اقتراح ذكي». الخاصية الجديدة ما تنشأ إلا لما تضغط استيراد، ولو كانت قائمة، خياراتها تنبني من القيم اللي في ملفك. وأي عمود يبقى بدون وجهة، نقول لك اسمه قبل ما يبدأ الاستيراد. السبب بسيط: الاستيراد ياخذ اللي قلنا له عليه بس، وما نبي عمود كامل يضيع وأنت ما تدري.
Suggestions show up on the mapping screen with an “AI suggested” badge. A new property isn't created until you hit import, and if it's a list, its options come from the values in your file. If a column has nowhere to go, we tell you its name before the import starts. The reason is simple: the import only takes what it was told about, and we don't want a whole column to disappear without you knowing.
نفس الرقم، مكتوب بكذا طريقةThe same number, written many ways
أكثر شي يخرّب الاستيراد هو رقم الجوال. نفس الرقم تلقاه ٠٥٥١٢٣٤٥٦٧ بالأرقام العربية، أو 551234567 بدون الصفر، أو 5.51234567E+08 لأن الخانة انحفظت بصيغة علمية. كلها نرجعها لصيغة وحدة: +966551234567.
The thing that breaks imports most is the phone number. You'll find the same number written as ٠٥٥١٢٣٤٥٦٧ in Arabic digits, as 551234567 without the zero, or as 5.51234567E+08 because the cell was saved in scientific notation. We turn all of them into one form: +966551234567.
بعد التوحيد نشيك على التكرار داخل الملف. الرقم اللي تكرر ما ينضاف مرتين، والصف اللي ما فيه رقم ما يدخل. ولو الرقم عندك من قبل، أنت تختار: نتخطاه ولا نحدّث بياناته.
Once they're in one form we check for repeats inside the file. A number that shows up twice is only added once, and a row with no number doesn't go in. If the number is already in your contacts, you choose whether we skip it or update it.
والملف يوصل لـ200 ألف صف. ما نرسله كتلة وحدة: نقسمه دفعات، كل دفعة 2,000 صف، والصفوف اللي لها نفس الرقم تبقى في نفس الدفعة. الاستيراد يشتغل في الخلفية، وأنت تكمل شغلك، ولما يخلص يجيك ملخص: كم انضاف، وكم تحدّث، وكم تخطّينا، وكم فشل لو صار خطأ.
A file can have up to 200,000 rows. We don't send it as one lump. It's split into batches of 2,000 rows, and rows that share a number stay in the same batch. The import runs in the background while you get on with your day, and when it's done you get a summary of how many were added, updated and skipped, and how many failed, if any did.
ليش سوّيناها كذاWhy we built it this way
كان ممكن نرسل الملف كامل للنموذج ونخليه يرتب كل شي. أسهل علينا، بس أبطأ، وفيه بيانات عملائك تطلع أكثر من اللازم. اللي سويناه: القواعد تشتغل أول، والذكاء الاصطناعي يجي بس للي ما فهمناه، وأنت تشوف كل شي قبل ما يصير.
We could have sent the whole file to the model and let it sort everything out. That would've been easier for us, but slower, and more of your customers' data would leave than needs to. What we did instead: the rules go first, AI only gets what they couldn't work out, and you see everything before it happens.
نفس الملف، قبل وبعدThe same file, before and after
اسحب الخط. من جهة الملف زي ما وصلنا، ومن الجهة الثانية نفس الصفوف بعد ما دخلت هاتف: الأرقام كلها بصيغة وحدة، المكرر ما انضاف، و«كود» ما له أثر.
Drag the line. On one side is the file as it arrived, on the other the same rows once they're in Hatif: every number in one format, the duplicates left out, and no trace of “Code”.
| رقم الجوّال | الاسم | المدينة | حالة العميل | كود |
|---|---|---|---|---|
| 0551234567 | سارة الدوسري | الرياض | مهتم | A-104 |
| ٠٥٠٢٢٢٣٣٤٤ | فهد الشمري | جدة | جديد | B-311 |
| 551234567 | سارة الدوسري | الرياض | مهتم | A-104 |
| 5.04411223E+08 | نورة العتيبي | الخبر | تم البيع | C-062 |
| عبدالله القحطاني | أبها | غير مهتم | X-093 | |
| 00966 55 765 4321 | ريم الحربي | الدمام | مهتم | Z-027 |
| +966 (53) 100-2030 | خالد الغامدي | مكة | جديد | B-415 |
| 966557654321 | ريم الحربي | الدمام | مهتم | Z-027 |
| رقم الهاتفPhone number | الاسمName | المدينةCity | الحالةStatus | |
|---|---|---|---|---|
| +966 55 123 4567 | سسارة الدوسري | الرياض | مهتمInterested | |
| +966 50 222 3344 | ففهد الشمري | جدة | جديدNew | |
| نفس رقم سارة الدوسري اللي فوق، ما انضاف مرة ثانيةSame number as سارة الدوسري above, not added twice | ||||
| +966 50 441 1223 | ننورة العتيبي | الخبر | تم البيعSold | |
| بدون رقم، ما انضافNo number, not added | ||||
| +966 55 765 4321 | رريم الحربي | الدمام | مهتمInterested | |
| +966 53 100 2030 | خخالد الغامدي | مكة | جديدNew | |
| نفس رقم ريم الحربي اللي فوق، ما انضاف مرة ثانيةSame number as ريم الحربي above, not added twice | ||||
جرّبها على ملفكTry it on your own file
الصق جدول من إكسل هنا، أو اسحب عليه ملف CSV. نفس القواعد اللي فوق تشتغل في متصفحك: نكوي العناوين، ونوحّد الأرقام، ونحسب الدفعات. وتشوف بالضبط وش كان بيروح للذكاء الاصطناعي.
Paste a table from Excel here, or drop a CSV on it. The same rules from above run in your browser: headers flattened, numbers normalised, batches counted. And you see exactly what would have gone to the AI.
كل شي يصير على جهازك. ما يطلع ملفك، وما نكلّم أي ذكاء اصطناعي.Everything happens on your device. Your file doesn't leave it, and no AI is called.