المدونةBlog

ملف عملائك، مهما كان شكلهYour contacts sheet, whatever it looks like

كيف يقرأ هاتف ملف الإكسل حقك، وليش الذكاء الاصطناعي يشوف منه أقل مما تتوقع.How Hatif reads your spreadsheet, and why the AI sees much less of it than you'd think.

محمد الكرديMohammed Alkurdi

عرض تجريبي لنافذة استيراد جهات الاتصال في هاتف: يُرفع ملف، تُربط الأعمدة المعروفة، يقترح الذكاء الاصطناعي وجهات الأعمدة الباقية، وبعد المراجعة يبدأ الاستيراد.A demo of Hatif's contact import dialog: a file is uploaded, known columns are mapped, AI suggests destinations for the rest, and after review the import starts.

عرض تجريبي، الأرقام للتوضيحDemo, figures are illustrative

أي أحد اشتغل في المبيعات أو خدمة العملاء عنده هالملف. إكسل فيه كم ألف رقم، كل عمود مسمّى على كيف اللي سوّاه، نصه عربي ونصه إنجليزي، وفيه عمود اسمه «كود» محد يتذكر وش هو. ترفعه على أي نظام وأول شي يطلع لك سؤال: هذا العمود وش هو؟ وتقعد تطابق عمود عمود.

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

عملاء_الرياض_2026.xlsx1,340 × 10
1رقم الجوّالرقم الهاتفPhone numberالاسمالاسمNameالإيميلالبريد الإلكترونيEmailالمدينة6 قيم6 valuesحقل جديد · قائمةNew field · listحالة العميل4 قيم4 valuesالحالةStatusتاريخ التسجيلأكثر من 20 قيمة20+ valuesحقل جديد · تاريخNew field · dateجوال ثانيأكثر من 20 قيمة20+ valuesأرقام هاتف إضافيةAdditional phone numbersالحيأكثر من 20 قيمة20+ valuesحقل جديد · قائمةNew field · listيرجع لكback to youملاحظات المندوبأكثر من 20 قيمة20+ valuesملاحظةNoteكودأكثر من 20 قيمة20+ valuesتجاهلIgnore
20551234567+96655123456705سارة الدوسريsara.d@mail.saالرياضمهتم2026-01-14 النرجسيبي عرض سعرA-104
3٠٥٠٢٢٢٣٣٤٤+96650222334405فهد الشمري جدةجديد2026-02-030540001122الروضةكلمه بعد العصرB-311
4551234567+966551234567بدون 0مكررduplicateسارة الدوسري الرياضمهتم2026-01-14 النرجس A-104
55.04411223E+08+966504411223علمينورة العتيبيnoura@mail.saالخبرتم البيع2026-03-21 العليامهتم بالباقة السنويةC-062
6 فاضيblankعبدالله القحطاني أبهاغير مهتم2026-04-02 المنهلما ردX-093
700966 55 765 4321+96655765432100ريم الحربيreem.h@mail.saالدماممهتم2026-05-180569998877الشاطئطلب يتواصل واتسابZ-027
8+966 (53) 100-2030+966531002030+خالد الغامدي مكةجديد2026-06-09 العزيزية B-415
9966557654321+966557654321966مكررduplicateريم الحربي الدماممهتم2026-05-18 الشاطئ Z-027
و1,332 صف ثاني تحت…and 1,332 more rows below…
  1. هذا ملف تجريبي فيه 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.

  2. أول شي نوحّد شكل العناوين: نشيل التشكيل والمسافات، ونوحّد الهمزات، فـ«رقم الجوّال» و«رقم الجوال» يصيرون نفس الاسم. ثلاثة منها طابقت أسماء نعرفها، فانربطت على طول، بدون أي ذكاء اصطناعي.

    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.

  3. السبعة الباقية بس تروح للنموذج. من كل عمود: العنوان، وخمس قيم مختلفة بالكثير، وكم قيمة مختلفة فيه. المظلل هو كل اللي يطلع من ملفك.

    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.

  4. يرجع الجواب والسيرفر يفحصه. «الحي» انقال عنه قائمة، بس فيه أكثر من 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.

  5. بعدها الأرقام. سبع صيغ مختلفة، وكلها ترجع بصيغة +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.

  6. وآخر شي الدفعات. كل دفعة 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.

HATIF

بطاقة العنوان اللي نفرزها الحينThe header card being sortedالصناديق من اليسار: الجوال، الاسم، خصائصك، الشركة، المنصب، الإيميل، جوال إضافيBins from the left: phone, name, your properties, company, position, email, extra phoneالصينية الأخيرة: اللي بيروح للذكاء الاصطناعيEnd tray: what goes to the AIالبكرتين تكوي العنوان: تشيل التشكيل والمسافات والشرطات وتوحّد الهمزات والياء والتاء المربوطة. بعدها يتقارن مع قائمة الأسماء المعروفة لكل حقل، بنفس الترتيب كل مرة.The rollers flatten the header: diacritics, spaces and dashes go, and the different forms of alef, yeh and teh marbuta are unified. Then it's compared with the known names for each field, always in the same order.

في الملف التجريبي فوق، ثلاثة أعمدة انعرفت على طول وما احتجنا أحد. السبعة الباقية هي اللي فعلًا تحتاج أحد يفكّر فيها.

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.
5 · 120 · 20
اللي ينرسلSent
الجوابAnswer

الرف: العنوان وخمس قيم بالكثير، وهذا كل اللي يطلعThe rack: the header and at most five values. That's all that leavesأربعة فحوص: شكل الجواب، الخاصية موجودة، الحقل ما انعطى قبل، القائمة 20 أو أقلFour checks: answer shape, property exists, field not taken, list of 20 or fewerورا: اقتراح يطلع لك · قدّام: تجاهل وأنت تقررBack: shown to you as a suggestion · front: ignored, you decideالعدّاد يوقف عند 21 لأن اللي يهمنا سؤال واحد: هل القيم 20 أو أقل؟ لو أقل، ممكن تصير قائمة اختيارات. الأجوبة هنا أمثلة لرد معتاد من النموذج، والفحوص حقيقية بنفس القواعد اللي في السيرفر.The counter stops at 21 because there's only one question it answers: are there 20 values or fewer? If so, the column can become a pick list. The answers here are examples of a typical model reply. The checks are the real ones the server runs.

أي جواب ما يعدّي الفحص ينشال، والعمود يرجع لك تقرر فيه. ولو النموذج تأخر أو تعطّل، ما يوقف شي: تطلع لك رسالة إن الاقتراحات مو متاحة الحين، وتكمل المطابقة بيدك مثل أول.

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.

+966

ورقة فيها رقم من ملفكA slip with a number from your fileالصندوق المقفل: 2,000 صف خلصتLidded crate: 2,000 rows doneالصينية ورا: فاضي أو مكررBack tray: blank or duplicateالعداد اللي ورا أول السير يوريك أي قاعدة طابقت. أول أربع أوراق شكلها مختلف بس كلها نفس الرقم، فوحدة بس تنضاف والباقي يطلع كمكرر. اللوحة اللي ورا تتذكر كل رقم مرّ عليها. والعداد اللي جنب الصناديق يحسبها: 200 ألف صف تعني 100 صندوق.The dial at the start of the belt shows which rule matched. The first four slips look different but they're the same number, so one goes in and the rest come out as duplicates. The pegboard at the back remembers every number it has seen. The dial next to the crates counts them: 200,000 rows means 100 of them.

والملف يوصل لـ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”.

عملاء_الرياض_2026.xlsx
رقم الجوّالالاسمالمدينةحالة العميلكود
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
جهات الاتصالContacts5 جديدة5 new
رقم الهاتفPhone numberالاسمNameالمدينةCityالحالةStatusكودCode
+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
قبلBeforeبعدAfter
نفس الصفوف الثمانية من الملف التجريبي فوق.The same eight rows from the sample file above.

جرّبها على ملفك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.

ذاك الملف اللي فيه عمود «كود»؟ ارفعه.That file with the “Code” column? Upload it.

من «جهات الاتصال» اضغط «استيراد» وارفع ملفك. اللي نعرفه ينربط على طول، والباقي يجيك عليه اقتراح، وأنت آخر واحد يقرر.In Contacts, hit Import and upload your file. What we recognise is mapped on the spot, the rest comes with a suggestion, and you have the final say.