# Error "Statement affected 0 row(s), but was expected to affect 1."

**URL:** <https://community.fibery.io/t/error-statement-affected-0-row-s-but-was-expected-to-affect-1/2132>\
**Category:** Bugs & Issues\
**Tags:** automations\
**Created:** [October 19, 2021, 5:59pm UTC](https://community.fibery.io/t/error-statement-affected-0-row-s-but-was-expected-to-affect-1/2132 "2021-10-19T17:59:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [October 19, 2021, 5:59pm UTC](https://community.fibery.io/t/error-statement-affected-0-row-s-but-was-expected-to-affect-1/2132/1 "2021-10-19T17:59:06Z")

</div>

This error is also (sometimes?) caused by specifying a value for `Id` in fibery.createEntity:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/6/613692e18b03d1126f5f39b766d090f6ad88e151.png)

AND - the entity is NOT created.

```auto
const utils = context.getService('utils')
const entity = args.currentEntities[0]
const type = entity.Type
const dateTime = new Date().toString()
console.log(`\n=========== Mark as Done "${type}" - ${dateTime} ===========\n`)
const newId = utils.uuid()
const templ = {
    "Rank": 10000,
    "Name": entity.Name + ' ' + dateTime,
    "Id": newId, //-- setting this causes error
    "State": "Not Started",
    "Enabled": true,
}
console.log( `🚗 create new entity "${type}": ${JSON.stringify(templ,null,2)}` )

const result = await fibery.createEntity(type, templ)
console.log( ` result: ${JSON.stringify(result, null, 2)}` )
```

---

<div class="post-metadata">

**Author:** ![Sergey\_Truhtanov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/sergey_truhtanov/32/13986_2.png) [@Sergey\_Truhtanov](https://community.fibery.io/u/Sergey_Truhtanov)\
**Post date:** [October 20, 2021, 2:50pm UTC](https://community.fibery.io/t/error-statement-affected-0-row-s-but-was-expected-to-affect-1/2132/2 "2021-10-20T14:50:18Z")

</div>

Wow. Didn’t expect anyone to manually set Id, while agree it can be useful in some cases.  
This is a bug from our side, fixed and will be released in an hour.
