I want to get user input in a certain line item related to number format but want to restrict the user input between 0 and 100. If the value input is between 0 to 100 then this value must be used as it is. But if the user input is <0 or >100 then it should return an error or must convert the value directly to the limit.
Summarised as follows:
User input = x
Case 1: if x >= 0 and x <= 100 then use x as it is.
Case 2: if x < 0 or x > 100 then either return an Error or change the value to x = 0(for x < 0) and x = 100(for x > 100).
You can not do any of that sort in the user input line item. Instead you can create another line item which will take the values from user input line item and you can write below logic in the second line item.
If X < 0 Then 0 else if X > 100 Then 100 ELSE X ELSE X
2. Evaluate if the value is above/below max/min thresholds (ex: IF input >= 0 AND input <= 100 THEN input ELSE IF input < 0 THEN 0 ELSE 100) - something of that nature should allow you to use the second line item as your main reference for any subsequent formulas.
Re: Restrict User Input in a Field to a certain range
The best approach here would be to use a list. Create a list using 1 - 100 with a property formatted as number from 1 - 100. Format your input with the list and create a additional line item formatted as number. Reference the list property so that you can convert the list selection to a number format to use in down stream calculations. This would be the easiest and simplest approach. However, you will not be able to set a default and will have to use one of the other methods if this is still required.
Chris Heathcote Bedford Consulting
Gold Partner and Regional Partner of the Year 2021, EMEA