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

Infinity DataSource Nested Object payload #549

Open
asergeant01 opened this issue Nov 14, 2024 · 3 comments
Open

Infinity DataSource Nested Object payload #549

asergeant01 opened this issue Nov 14, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@asergeant01
Copy link

asergeant01 commented Nov 14, 2024

I am following this blog post.

My Update Request "Create Payload" is basically:

var jsonData = {
  "createdBy": createdBy,
  "startsAt": startTime,
  "endsAt": endTime,
  "comment": comment,
  "matchers": matchers
}

return jsonData;

Whereby matchers is a further array of objects that is dynamically build based from form data.

My Query Editor "URL options" body content is the following:

{
  "createdBy": "${payload.createdBy}",
  "startsAt": "${payload.startsAt}",
  "endsAt": "${payload.endsAt}",
  "comment": "${payload.comment}",
  "matchers": ${payload.matchers}
}

This produces the following output on the request:

"executedQueryString": "###############
## URL
###############

https://<HIDDEN>

###############
## Curl Command
###############

curl -X 'POST' -d '{ 
\"createdBy\": \"alan\",
\"startsAt\": \"Thu Nov 14 2024 11:24:27 GMT+0000 (Greenwich Mean Time)\",
\"endsAt\": \"Sat Nov 16 2024 11:24:27 GMT+0000 (Greenwich Mean Time)\",
 \"comment\": \"Alan Test\",
\"matchers\": [object Object],[object Object],[object Object],[object Object]
}' -H 'Accept: application/json;q=0.9,text/plain' -H 'Authorization: Basic xxxxxxxx' -H 'Content-Type: application/json' 'https://<HIDDEN>'"

I would expect it to parse this or alternatively, provide the option to let the developer build the full body in "create payload" and return the JSON.stringify which can be inserted into the body content using ${payload}

@mikhail-vl mikhail-vl added the question Further information is requested label Nov 15, 2024
@mikhail-vl mikhail-vl moved this to Ready in Business Suite Nov 15, 2024
@mikhail-vl mikhail-vl added enhancement New feature or request and removed question Further information is requested labels Nov 18, 2024
@mikhail-vl mikhail-vl added this to the Forms 5.0.0 milestone Nov 18, 2024
@mikhail-vl
Copy link
Member

@asergeant01 Thank you for bringing it to our attention.

We discussed it with the team and will look into improving objects in the upcoming release.

@asergeant01
Copy link
Author

@mikhail-vl Awesome. Thanks. Until such times and for anyone else finding this, I was able to work around using the following:

var jsonData = {
  "createdBy": createdBy,
  "startsAt": startTime.toISOString(),
  "endsAt": endTime.toISOString(),
  "comment": comment,
  "matchers": JSON.stringify(matchers).replaceAll('\"', '\\"')
}

@mikhail-vl
Copy link
Member

@asergeant01 Thank you for providing temporary solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Ready
Development

No branches or pull requests

4 participants