bitfocus / companion-module-generic-http

Generic HTTP module
MIT License
9 stars 19 forks source link

[BUG] Strings from JSON Stringify give error when using substring function #31

Open JonathanGale opened 2 years ago

JonathanGale commented 2 years ago

When a custom variable is populated with a string using JSONresult's Stringify, it appears fine, however the substring function doesn't see it as a string.

When Companion is initialized, the startup variable is properly parsed by substring, however after it's updated using JSONresult, the log gives an error: "instance(internal): Error executing action: variable_value.substring is not a function." under custom variables, the variable appears as a regular string, and otherwise acts as intended.

To replicate: create 3 custom variables String1 = Returned data in JSON format. String2 = Using the internal 'JSONresult via JSONpath', return any piece of data. In my case, I'm pulling ProPresenter's playlist.name, from returning a full playlist. String2 = set a substring of String1, and set a startup value.

When Companion is initialized, the startup variable is properly parsed by substring, however after it's updated, the log gives this error: "instance(internal): Error executing action: variable_value.substring is not a function."