Route data to the Addon's Input - string instead of id

Options

Hello πŸ‘‹

Is there a way to pass a string value as input to an addon?

A static string works, but I want to pass a dynamic text value, the add on route dropdown defaults to only integer / id type.


I realise an ID would be better / quicker, but what I'm trying will do the job easily.

Thanks for any insight πŸ˜€

Tagged:

Best Answers

  • arturosanz
    arturosanz Member ✭✭
    Answer βœ“
    Options

    One way to pass a dynamic text value into a static string is by using the sprintf filter. Just insert %s in the static text and apply the sprintf filter to it, so you can replace %s with any variable value (converted to text first, of course).

  • rozza
    rozza Member ✭
    Answer βœ“
    Options

    @arturosanz Thanks for your input. A neat suggestion.
    I was trying to addon to an aggregated query, which forces the need for a number value to be passed.

    Thank you!