Skip to main content

We want to make an alert within an inputbox that is related to an action (view) that leads to an increased attribute indicating that it has exceeded a maximum number of characters. Do you know how to achieve this?

Hi Maicol,

so you have an inputbox and when the input exceeds a given number of characters you want to give a warning correct?

If the warning can happen right away in the view, I would suggest you write the input from the inputbox to a runtime variable and then have a KPI checking the length of that variable, giving appropriate warnings. You can then display the KPI right next to your input box:

  1. Create Runtime variable: Name = value_box_input, the value has to be one space
  2. Create KPI in your knowledge model: Name = Value Box Check, PQL = CASE WHEN len('${{input_box_value}}') > 10 THEN 'Input to large' ELSE 'Input Valid' END
  3. Create your input box with the following yaml:

type: input-box

settings:

  type: string

  value: ""

  onChange:

    update:

      variables:

        - name: input_box_value

placeholderText: Type your input

 

Then you can place your KPI in a KPI-List component right next to your input box and see the screenshot for how it would look like:imageLet me know if that helps or if you have a question about it.

Best,

Tim


Reply