# Problem evaluating script Invalid input (

**URL:** https://forum.flowable.org/t/problem-evaluating-script-invalid-input/10955
**Category:** Flowable Engine
**Created:** [October 24, 2023, 5:23am UTC](https://forum.flowable.org/t/problem-evaluating-script-invalid-input/10955 "2023-10-24T05:23:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Karan1](https://avatars.discourse-cdn.com/v4/letter/k/7cd45c/32.png) [@Karan1](https://forum.flowable.org/u/Karan1)
#### Post date: [October 24, 2023, 5:23am UTC](https://forum.flowable.org/t/problem-evaluating-script-invalid-input/10955/1 "2023-10-24T05:23:34Z")

</div>

Hi,

I am trying the below code. But the line of code starting with openidm.patch() is giving error like below

`problem evaluating script: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script3.groovy: 5: Unexpected input: '(' @ line 5, column 16. openidm.patch("managed/user/" + userQry.result[0]._id, null, [{"operation":"replace", "field":"/givenName", "value":givenName}]) ^ 1 error`

If I remove the above line, there is no compilation error.

Below is the code for the reference. Please refer the openidm.patch line and let me know if there is any issue with it.

```auto
    <scriptTask name="Create User" id="createManagedUser" scriptFormat="groovy" flowable:autoStoreVariables="false">
      <script>
		def userQry = openidm.query("managed/user", ["_queryFilter": '/userName eq "'+userName+'"'])
		console.log("User query result is " + userQry)
		console.log("givenName is " +givenName)
		openidm.patch("managed/user" + userQry.result[0]._id,null,[{"operation":"replace","field":"/givenName","value":givenName}])
            def manager = (userQry.result.size() == 1) ? ("managed/user/" + userQry.result[0]._id) : null
            user = [
                userName:userName,
                givenName:givenName,
                sn:sn,
                mail:mail,
            ]
            readNewUserFromRepoParams = [_queryId:'for-userName',uid:userName]
            execution.setVariable("readNewUserFromRepoParams", readNewUserFromRepoParams)
        </script>
    </scriptTask>

```

---

<div class="post-metadata">

### Author: ![valentin](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/valentin/32/3367_2.png) [@valentin](https://forum.flowable.org/u/valentin)
#### Post date: [October 24, 2023, 8:36am UTC](https://forum.flowable.org/t/problem-evaluating-script-invalid-input/10955/2 "2023-10-24T08:36:07Z")

</div>

There is a related stackoverflow post:

> <https://stackoverflow.com/questions/77349720/flowable-problem-evaluating-script-invalid-input>
