-
|
Hi, is there a way to access value of I've tried using something like this but you can't change value in cue so assigning to |
Beta Was this translation helpful? Give feedback.
Answered by
myitcv
Aug 23, 2023
Replies: 1 comment 1 reply
-
|
Something like this perhaps: import "strings"
input: {
another: {
example: "sure"
}
}
index: "another.example"
_splitIndex: strings.Split(index, ".")
_resolvedValues: [for i, v in _splitIndex { [if i==0 {input}, _resolvedValues[i-1]][0][_splitIndex[i]] }]
output: _resolvedValues[len(_resolvedValues)-1]gives: |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
milosjost
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Something like this perhaps:
gives:
https://tip.cuelang.org/play/?id=1NrNflvLB8Z#cue@export@cue