Placing concatenated string into output array
See original GitHub issueInput
{
"id": "01001",
"name1": "Larry",
"name2": "Bird",
"content1": "Basketball",
"content2": "Court",
"content3": "Stadium"
}
Spec
[
{
"operation": "shift",
"spec": {
"content1": [
"sports[1].name",
"player.details[0].sport"
],
"content2": "sports[0].location",
"id": "player.id",
"name1": "player.firstname",
"name2": "player.lastname"
}
},
{
"operation": "modify-default-beta",
"spec": {
"player": {
"details": {
"0": {
"fullname": "=concat(@(1,name1),' ',@(1,name2))"
}
}
}
}
},
{
"operation": "default",
"spec": {
"player": {
"details[]": {
"0": {
"teamname": "Celtics"
}
}
}
}
}
]
Output
{
"sports" : [ {
"location" : "Court"
}, {
"name" : "Basketball"
} ],
"player" : {
"details" : [ {
"sport" : "Basketball",
"teamname" : "Celtics"
} ],
"id" : "01001",
"firstname" : "Larry",
"lastname" : "Bird"
}
}
I am attempting to get the full name placed in the details array in the player object. I have a feeling it has to do with navigating the tree, but I have been unable to get the values. If you see where this went wrong, your assistance would be greatly appreciated!
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
concatenate array elements to form a string - JavaScript
The string that results from converting each element of array to a string and then concatenating them together, with the separator string between...
Read more >String Concatenation in C++: 4 Ways To Concatenate Strings
The strcat() function takes char array as input and then concatenates the input values passed to the function. Syntax: strcat(char *array1, char ...
Read more >How to concatenate 2 or more strings as one inside a string ...
Probably the most concise way is: Construct an array of the right size: String[] result = new String[A.length - (y-1)];.
Read more >Solved: Array (Select) output to a concat string
I'm trying to get a list of email addresses from a Get Items action and use them to create a variable which will...
Read more >How to concatenate strings in C: A five minute guide
Concatenation involves appending one string to the end of another string. For example, say we have two strings: “C programming” and “language”. ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah, each operation takes as input the output from the operation before it. Its a transform pipeline.
Thank you for the information! So, in a chain spec, the first operation can see the source JSON. I am assuming the operations are executed in order. So, the source JSON is available for the 1st operation, the result of that is available to the 2nd, and so on…right? Just trying to better understand the mechanics of how operations are processed and what data is available where.