File this under “molehills turning into mountains”:
I’m trying to use a flow function to set one page variable using a formula that is dependent on picking out a certain character from another page variable. However, the usual pageVars.xyz[#] syntax keeps evaluating to “undefined” according to the debugger. I can’t figure out why, and it’s driving me absolutely insane – it seems like the tiniest, least complex problem in the world but it’s had me stuck for hours.
To simply illustrate the issue, I created a page variable called “test” of type = text and initial value = “abc”.
Evaluates to “a” when the flow function is triggered:
Evaluates to “abc” when the flow function is triggered:
Evaluates to “undefined” when the flow function is triggered:
You’ll notice that the formula example results expect the string slice to evaluate to a character… and yet, when previewing my app and looking at the debugger, it just doesn’t.
Please help because I’m about to throw my laptop out the window. THANK YOU!
This is actually a bug since Composer doesn’t support “text” type of notation, so the undefined response is the correct one in this case. I have filed a bug report about the formula editor suggesting a response other than undefined to prevent any further confusion, thanks for bringing this to our attention!
Perhaps a formula function like SUBSTRING() would help you to get specific letters from a string?
Thanks for filing it! Is there a reason AppGyver shouldn’t/won’t support “string” notation for variables? The fact that my “abc” example evaluated to “a” makes it seem like it should be very attainable, and it is a helpful functionality.
I ended up discovering & using STRIP_RIGHT() and STRIP_LEFT() because what I wanted was the first or second character in a two-character string.
Great that you found a workaround for your app!