Camunda connector with dynamic values

I am working on a connector which calls Graph API search endpoint. I need to setup the URL dynamically with searchText but get following error:

ERROR: failed to parse expression '"https://graph.microsoft.com/v1.0/sites/"+siteId+"/drive/root/search(q='"+searchText+"')': Expected (binaryComparison | between | instanceOf | in | "and" | "or" | end-of-input):1:85, found "+\"')"

Thanks

Hi @Manju_Sudan, welcome to the forums! Can you share the full expression you are using?

Hi Nathan,

Here is how it is set in connector json:

{
      "id": "searchItemURL",
      "type": "Hidden",
      "value": "=\"https://graph.microsoft.com/v1.0/sites/\"+siteId+\"/drive/root/search(q='\"+searchText+\"')",
      "binding": {
        "type": "zeebe:input",
        "name": "url"
      },
      "condition": {
        "property": "sharePointOperation",
        "equals": "searchItem"
      }
    }

Thank you,
Manju

At first glance, that FEEL expression looks correctly and looks correctly escaped. I will have to do some testing.

What value does searchText have during your testing? Have you tried escaping the single quotes? Those are two of the things I would test first.

searchText would be a simple string like document1. I have also tried escaping single quotes but doesn’t work.

Hey @Manju_Sudan - a coworker found the problem! There is a missing double-quote at the end of the expression.

Original:
"=\"https://graph.microsoft.com/v1.0/sites/\"+siteId+\"/drive/root/search(q='\"+searchText+\"')"

Corrected:
"=\"https://graph.microsoft.com/v1.0/sites/\"+siteId+\"/drive/root/search(q='\"+searchText+\"')\""

The first escaped double quote (=\"https) isn’t closed at the end of the expression.

There was also a suggestion to maybe use string(siteId) instead of just siteId in the string interpolation:

If the siteId is a number then the expression will parse / be deployable without problems but during runtime it will evaluate to null . It will work again wrapped in a Feel string()-function

Hopefully this resolves your issues!

Hi Nathan,

Awesome! That worked!

Thanks for your and your coworker’s help :slight_smile:

Regards,
Manju Sudan

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.