Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split function returns error for valid Jsonata expression #287

Open
ghadaobaid opened this issue Nov 8, 2023 · 2 comments
Open

Split function returns error for valid Jsonata expression #287

ghadaobaid opened this issue Nov 8, 2023 · 2 comments

Comments

@ghadaobaid
Copy link
Collaborator

For the JSON below:

{
  "predictions": [
    {
      "fields": [
        "Response_message_field"
      ],
      "values": [
        [
          "#Inventory #Signature"
        ]
      ]
    }
  ]
}

The expression predictions.values[0][0].$split ($,"#") returns the error:
Argument 3 of function $split does not match function signature

@wnm3
Copy link
Member

wnm3 commented Nov 8, 2023

The $ parameter isn't needed, but it should still work. I'll see if I can get this fixed. In the meantime, just use $split("#") and you'll get the same results as https://try.jsonata.org/LbQMukM1R

wnm3 added a commit that referenced this issue Nov 8, 2023
@wnm3
Copy link
Member

wnm3 commented Nov 8, 2023

I've pushed a fix to the Split code to handle if a $ is passed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants