Access display_value field with tableapi #184
Replies: 7 comments
-
For anyone else looking for this, setting ExcludeReferenceLink: true (which does not use tableapi.TRUE ?) gets rid of that internal map and makes Value() return the display value. If you don't need these other fields, that works |
Beta Was this translation helpful? Give feedback.
-
To answer your question, each value should be a TableEntry, so you can utilize the Get("") which will yield a TableValue from there you can use the ToX methods to get the value... or ideally that's how it would work, looking at it closer you'd only be able to get the key "value" so it'll need a rework to be more effective. Ideally something like: entry.Get("").DisplayValue().ToX() |
Beta Was this translation helpful? Give feedback.
-
Regarding the note about I considered renaming It might be best to settle for renaming it with the same type and string value. |
Beta Was this translation helpful? Give feedback.
-
Just merged PR #158 to improve the naming convention for the enums! |
Beta Was this translation helpful? Give feedback.
-
Rough PoC but I think this will work better than the current implementation: type TableRecord interface {
Get(“<field name>”) RecordElement
Set(“<field name>”, <val>)
HasAttribute(“<field name>”)
}
type RecordElement interface {
GetDisplayValue() ElementValue
GetValue() ElementValue
GetLink() str
}
type ElementValue interface {
GetInt64Value() *int64
GetStringValue() *string
GetBoolValue() *bool
GetXValue() *X
} |
Beta Was this translation helpful? Give feedback.
-
@Ulrar I just created 1.7.0-RC1 to address this issue! It would be great if you could try it out and let me know if this is the experience you're expecting! Thank you! |
Beta Was this translation helpful? Give feedback.
-
Issue will be resolved in v1.7.1 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
❓ Question or Support Request
It looks like TableEntry's Value() has "value" hard coded as the inner map's key, so it looks like there is no way to access the other fields like display_value.
The above returns something like this :
From what I understand of the code, none of these inner fields can be accessed. Am I missing something ?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions