251 questions
0
votes
1
answer
48
views
How to merge two objects in Amazon States language
The context is the design of an AWS Step Function, using the Amazon States language.
I want to call a lambda Task as a step. The state output of this step should be the merger of state input and a ...
0
votes
1
answer
58
views
Set MessageGroupId and MessageDeduplicationId in SQS in a JSONata step function
I am trying to use JSONata for my new step function and I am having issues setting the MessageGroupId and MessageDeduplicationId, for some reason they are not taken into account so it deduplicates the ...
0
votes
1
answer
66
views
How to combine column names and values?
I'm getting this type of JSON back from a system, and I need to combine it into an array of name-value pairs (typical to how, say, .NET would serialize DataTable).
{
"totalRows": 10,
&...
-1
votes
1
answer
93
views
JSONata base64 to hex
I have UUIDs stored in DynamoDB. In the ddb table, they are stored as binary ('B' AttributeValues) 32 byte values. When queried with GetItem, this data is returned to the client as a base64 encoded ...
0
votes
1
answer
29
views
Fetch non-array objects in collection with certain value
Given a collection (not an array) like this:
{
"field1": {
"type": "string",
"value": "test"
},
"field2": {
"type&...
2
votes
1
answer
71
views
I'm trying to use Jsonata to calculate the elapsed time between consecutive records in my data set
I have an array of objects where each object has a timestamp. I need each object in the array to be given an additional property -- "elapsed" and have it assigned the milliseconds that ...
1
vote
1
answer
123
views
Referencing a JSON key dynamically
My JSON object has keys that are strings that are dynamically generated with the json is created. Trying to access the first key doesn't seem to work.
This is my jsonata expression
(
$firstDate := ...
1
vote
1
answer
91
views
How to check "not equal" in JSONata for a string filter?
Trying to filter out a specific string value in JSONata but getting unexpected results.
JSON input:
{
"Account": {
"Account Name": "Firefly",
"Order": ...
1
vote
2
answers
89
views
How to transform JSON array?
I need to transform this json array:
[
{
"timestamp": "2025-01-19T17:00:00Z",
"absoluteDeviationsX": [10, 11, 12 ]
},
{
"...
2
votes
2
answers
2k
views
How do I evaluate JSONata expression in key in json?
I want to evaluate jsonata expression in key in AWS Step functions. I tried this:
{
"ApplicationId": "ID",
"SendUsersMessageRequest": {
"MessageConfiguration&...
0
votes
1
answer
47
views
In JSONATA how to add the values
here I have to add price and quantity combined
Excepted output:
price 10+2=12
+
Quantity2+1=3
combing both Excepted output as 12+3=15
(In JSONata how to do sum of the values)
"Order": [
...
0
votes
2
answers
64
views
How to add suffix st or nd or rd depond on number?
How to add suffix like "st", "nd", or "rd" depending on number in JSONata?
I want to achieve something like this:
If number is 1, output "1st"
If number is 2, ...
0
votes
2
answers
209
views
Remove objects from array if they exist in another array
I am exploring JSONAta right now for fun and have a question on how to solve something.
I would like to remove objects from an array that exist in another array based on a match of the entire object (...
0
votes
1
answer
83
views
Using JSONata to group by a property value
I would like to use JSONata to reformat a JSON response into a different structure grouped by values in the object. I've searched StackOverflow but cannot see an example that matches my needs. I ...
0
votes
1
answer
95
views
Parsing Spotify Web API results with JSONata in iOS shortcuts
I'm trying to get the results from a JSONata expression to print out using HTML and Javascript, but I'm not having any luck. The expression works in the JSONata playground and produces the array I ...
0
votes
1
answer
46
views
Maintaining data structure while filtering out nodes in JSONata
Our company sells subscriptions. On renewal we want to get the subscription data, remove the discount rateplancharge, and maintain the entire data structure for other downstream processes. Here is ...
0
votes
3
answers
84
views
Removing an array object from main Object
I am trying to remove an array object based on value of array object property by using JSONATA transform function but the array object is not getting removed. If pmtDtls.lnAprvlStatus ='D', the object ...
0
votes
2
answers
85
views
how to merge children to an array in jsonata
How can I merge the objects from "123" and "Trilby hat"
{
"123": {
"Price": 68.9,
"Qty": 2,
"ProductID": 858383
},
"Trilby hat": ...
1
vote
1
answer
117
views
Combine dictionaries with same key using JSONata
I am trying to combine the information from two dictionaries into one. I have a JSON like this:
{
"First": {
"example1": [
{
"key": &...
0
votes
1
answer
232
views
Jsonata Transformation to extract a value and make it a key
Jsonata newbie here. I need help with Jsonata Transformation to extract a value from json element and make it as key .
{
"key-1":[{
"id":"a",
"value":2.3
},{...
1
vote
2
answers
509
views
Get the top n items in array with JSONata
How can I get the top 5 keys with the highest values from a JSON using JSONata?
Let's say I have something like this. They keys aren't alphabetically ordered, but the values are descending and I want ...
0
votes
1
answer
544
views
In JSONata How to print date from todays date+60 calendar days
For eg:
if today's date is 03/39/2024, it should print after 60 days -05/28/2024
Code to get today's date:
$fromMillis($toMillis($now()), '[M01]/[D01]/[Y0001]')
But how to print for 60 calendar ...
0
votes
1
answer
328
views
jsonata expression to append the value
i have a json object as in below
{
"_namespace": "kubernetes",
"api_paths": [
{
"api_action": "post",
"api_path": "...
1
vote
1
answer
99
views
How to get the right grouping in my JSONata code?
Given an example JSON data like this:
{
"payload":
[
{
"lspf_numlot": "22701-15",
"prop_attrezzatura": "OP5 ...
1
vote
1
answer
71
views
Grouping Data by categoryId with JSONata
The challenge arises when some entries have multiple categoryIds, resulting in difficulties in proper grouping
I was able to group the data with the '$distinct' method, but some of the data has more ...