Skip to main content
Developer Communities Admin
Community Manager
September 15, 2026

Transform Mobile contact type to omit special characters AND return only the last 10 digits?

  • September 15, 2026
  • 4 replies
  • 2 views

Originally posted by Barbara Buchanan on February 24, 2026 at 4:00 PM.

 

Transform Mobile contact type to omit special characters AND return only the last 10 digits?

 

Due to system data, I need to transform employee mobile numbers to remove special characters and return the last 10 digits using Integration Studio (Bulk Benefits connector). Using system-provided Transformation, I am able to remove special characters or select the last 10 characters but cannot do both. Is there a way to use an IDL expression to combine the two functions? I am using last 10 for the preceding field and have a comparison of the IDL for the 2 fields, which is attached. Is it possible (and how, please) to combine the two statements and get both transformations to apply? I am unclear on syntax for expressions. Is this the right forum?

 

Thank you in advance for any help you can provide!

 

    4 replies

    Developer Communities Admin
    Community Manager
    September 15, 2026

    Originally replied by Brenda Sutton on Feb 24, 2026, 4:39 PM.

     

    Hi @Barbara Buchanan​,

    You currently have:

    • HomePhone → takes
    • string_right(..., 10)
    • but does NOT strip special characters
    • CellPhone → strips characters via nested
    • replace()
    • calls but then applies logic inconsistently and gets very heavy

    You're essentially trying to do:

    1. Find the phone
    2. Remove special characters
    3. Return last 10 digits
    4. Apply layout if needed

    The good news: you can dramatically simplify this using

    string_chars() + filter(is_numeric)

     

    instead of all those nested

    replace()

    calls.

     

    ✅ Clean, Combined Solution (Recommended)

    Below is the clean IDL version for Mobile that:

    • Finds the Mobile contact
    • Removes all non-numeric characters
    • Returns last 10 digits
    • Returns nil if nothing valid

     

     

    let mobileRaw =

    find(srcEmployeeRecords?.ContactDetails?,

    cd => cd?.ContactInformationType? =~ "Mobile")

    |> map_single(cd => cd?.ContactInformation?) ?? nil;

     

    let digitsOnly =

    if is_material(mobileRaw) {

    mobileRaw

    |> string_chars()

    |> filter(ch => is_numeric(ch?))

    |> join()

    } else {

    nil

    };

     

    if is_material(digitsOnly) && string_length(digitsOnly) >= 10 {

    digitsOnly |> string_right(10)

    } else {

    nil

    }

     

     

    🔎 Why This Is Better (Product + Technical View)

    Instead of:

     

     

    replace(replace(replace(replace(replace...

     

    We use:

     

     

    string_chars()

    |> filter(is_numeric)

    |> join()

     

    This removes:

    • +
    • spaces
    • ()
    •  
    • country codes
    • anything not 0–9

    It’s cleaner, safer, and future-proof.

    💡 If You Also Want the Layout (##########)

    If your vendor requires strict numeric layout validation like you’re doing, wrap the last line like this:

     

     

    if is_material(digitsOnly) && string_length(digitsOnly) >= 10 {

    string_lay_out(

    digitsOnly |> string_right(10),

    "##########",

    "#"

    )

    } else {

    nil

    }

     

    🏗 Same Logic for HomePhone

    Just change

    "Mobile"

    to

    "HomePhone"

    and reuse the same structure.

    🎯 What Was Breaking Before

    1. Your nested
    2. replace()
    3. logic was fragile
    4. You were applying
    5. string_right()
    6. before stripping characters
    7. There’s a syntax issue in your uploaded mapping here:

     

     

    string_right((replace(...),10) "##########", "#")

     

    You're missing a comma between the

    string_right()

    and the layout arguments.

    🚀 Strategic Recommendation (Cleaner Architecture)

    Instead of repeating the

    find()

    logic twice (Home + Mobile), you could standardize like this pattern:

     

     

    let getPhone = (type) =>

    find(srcEmployeeRecords?.ContactDetails?,

    cd => cd?.ContactInformationType? =~ type)

    |> map_single(cd => cd?.ContactInformation?) ?? nil;

     

    Then call:

     

     

    let mobileRaw = getPhone("Mobile");

    let homeRaw = getPhone("HomePhone");

     

    This keeps your mapping maintainable long term — especially important in Bulk Benefits feeds that tend to evolve.

    ✅ Final Answer to Your Core Question

    Is it possible to combine the two transformations in IDL?

    Yes — absolutely.

    You simply chain them:

     

    string_chars()

    → filter(is_numeric)

    → join()

    → string_right(10)

     

    That’s the clean and supported way to do it. Please let me know if the above helped😉

    Developer Communities Admin
    Community Manager
    September 15, 2026

    Originally replied by Barbara Buchanan on Feb 25, 2026, 1:03 PM.

     

    Thank you, Brenda. I appreciate the detail. It worked perfectly! It's a keeper! Barb 😊

    Developer Communities Admin
    Community Manager
    September 15, 2026

    Originally replied by Brenda Sutton on Feb 25, 2026, 2:32 PM.

     

    AWESOME! Appreciate you letting me know. It's good to have these types of examples on our side too. Have a great rest of your day! 😎

    Developer Communities Admin
    Community Manager
    September 15, 2026

    Originally replied by Barbara Buchanan on Feb 25, 2026, 2:49 PM.

     

    Thank you! And FYI, I was immediately able to apply this information to coalesce (mailingaddress, primaryaddress) which is important for this integration.