# Ask ICP AI solved my record extension syntax with more than one extension question!

**URL:** <https://forum.dfinity.org/t/ask-icp-ai-solved-my-record-extension-syntax-with-more-than-one-extension-question/31909>\
**Category:** Language Support\
**Tags:** Motoko\
**Created:** [June 13, 2024, 8:50pm UTC](https://forum.dfinity.org/t/ask-icp-ai-solved-my-record-extension-syntax-with-more-than-one-extension-question/31909 "2024-06-13T20:50:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![icme](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/icme/32/4327_2.png) [@icme](https://forum.dfinity.org/u/icme)\
**Post date:** [June 13, 2024, 8:50pm UTC](https://forum.dfinity.org/t/ask-icp-ai-solved-my-record-extension-syntax-with-more-than-one-extension-question/31909/1 "2024-06-13T20:50:45Z")

</div>

TLDR: Ask ICP AI is awesome.

I wasn’t able to find an example of how to use the `with` keyword with more than one override and was fumbling in finding the syntax, so I asked the ICP Docs AI.

It gave me this response

```auto
{ <exp1> and ... <expn> with <exp-field1>; ... <exp_fieldn>; }

```

I realize this might be a bit technical for some, so a simple example would look like:

```auto
let myRecord = {
  a = 1;
  b = 2;
  c = 3;
};

let myExtendedRecord = {
  myRecord with
    d = 4;
    e = 5;
    ...
};

```

If you have more than one record it could look like

```auto
let r1 = {
  a = 1;
  b = 2;
  c = 3;
};

let r2 = {
  c = 3;
  d = 4;
};

let myExtendedRecord = {
  r1 and r2 with
    // since c appears in both r1 and r2, need to specify what c is
    c = r2.c;
    e = 5;
    ...
};

```

---

<div class="post-metadata">

**Author:** ![ckMood](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/ckmood/32/13673_2.png) [@ckMood](https://forum.dfinity.org/u/ckMood)\
**Post date:** [June 13, 2024, 10:35pm UTC](https://forum.dfinity.org/t/ask-icp-ai-solved-my-record-extension-syntax-with-more-than-one-extension-question/31909/2 "2024-06-13T22:35:13Z")

</div>

Cool stuff! Thanks for sharing!
