String operations in Code #88
-
Is it possible to use Javascript/Flutter syntax for string operations in a code block? For example (from a DropDown element):
When I try this, the Text element with the id 'card' doesn't update. If I remove the substring method, it does. I have also tried charAt, substr, and slice without any success. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi @DonalRafferty yes it is possible. We have unit tests too that cover this here - https://github.com/EnsembleUI/ensemble_ts_interpreter/blob/master/test/new_interpreter_tests.dart All the supported string functions are in _String class here - https://github.com/EnsembleUI/ensemble_ts_interpreter/blob/master/lib/invokables/invokablecontroller.dart I'll look at your screen and debug what's going on. Your syntax is correct. Just to confirm - if you just do - card.text = this.value This works but when you substring, it doesn't? Could you please share what is this.value? |
Beta Was this translation helpful? Give feedback.
-
@DonalRafferty I believe I am looking at the right screen definition - Product Code Demo. I couldn't find a field with id: card there. Is it on a different screen? |
Beta Was this translation helpful? Give feedback.
-
@DonalRafferty see string related examples here: |
Beta Was this translation helpful? Give feedback.
@DonalRafferty see string related examples here:
https://studio.ensembleui.com/app/e24402cb-75e2-404c-866c-29e6c3dd7992/screen/bf9e503e-286b-437a-a692-14d0d5814918