Companion App Android Widgets. Trying to call script with parameters

Hi,

I am trying to set up a call service widget with the Android version of the companion app in order to run a script. The problem I have is that the script requires parameters passed into it. Is this possible and if so how?

Thanks

Managed to solve the problem myself. Yes it is possible by using the Add Field option when creating the widget. The problem I has is that each time you go back to edit the widget it looses all the fields that you have added.

I believe this should be fixed in the latest production release. The data was still there just didn’t get displayed properly.

Thanks for replying. I am running version 2023.8.2-full and have done some further testing and have found the following.

It would appear that if you add a field and then go back into the setup for the widget after saving, the fields are not displayed as you have stated.

If you then exit the widget settings without saving the fields and values are retained and the the action works as expected.

If, however, you save the widget, even without making any changes, the fields and values are removed.

Sounds like a bug then, please submit an issue on GitHub making sure to complete the issue template with the requested logs.

Hi,
I am trying to accomplish the very same thing. But I just don’t get it working. Could you please post a screenshot of your widget?
I have tried so many things like adding single quotes, double quotes, order of parameters… but it just does not work.
I have the feeling that the field names are not parsed correctly. My parameter name contains only small letters and an underscore. But after entering the name, lets say “test_parameter”, it is displayed as “Test parameter”. I don’t know if this is an issue, but it is at least confusing… :thinking:

Hi,

Here is a screen shot and it working as it should. I also created a widget with the field name test_mode. This is displayed in the widget as Test Mode but is referenced in the script as test_mode.

Hey @glyn ,
Thanks a ton for your quick response!
I don’t know where my error was. Maybe a typo or copy paste error. But I tried it once more and for some reason it works now.
This is my script call:

But what is still worth to mention: the parameter names (field names) are used to be without capitals and with an underscore instead of a space. This is changed in the moment where I save the field while editing. From my point of view this is confusing because it is not expected.

Anyway, apart from this my script call works now!

Thank you again!

there was a bug in previous versions that prevented the app from showing the correct fields.

might just be a display issue, if you check the companion app logs you’ll see the actual data that we saved and send for the service call. Thats the actual data to go by.