Dynamic choice based on a number

I guess I didn’t find my answer after reading other topics.

I have a total_amount field and another field with the number of quotas.
I created a math column that divides total_amount by quantity to get the value of one quota.

I didn’t like to use number entry because of min and max input. I thought the user could not enter a number of the limit. so, looking at the number of quotas, I´d like to create a dynamic choice base on this quantity.

if it´s 5 quotas, then the choice will have 5 elements, if it´s 3 quotas, the choice will have 3 and so forth.

thx in advance

If I understand correctly, you’re wanting to dynamically generate a unique list from a single column to use in a choice component. Is that correct? If yes, then here is one way:

  • I’ll assume that the column to create the unique list from is called “Quotas”
  • Firstly, ensure that your table has a RowID column
  • Create a single relation column, that links Quotas to itself
  • Create a lookup column that fetches the RowID column via that relation
  • Now create an if-then-else column that compares the lookup RowID to the actual RowID. If it matches, return true, else return blank.
  • Now you can use the Quotas column in your choice component, and filter it where that if-then-else is true.
1 Like

Thx Darren for your reply and pls look over my English mistakes. I’m from Brazil.

Here it´s my screen and I’m gonna try to translate.
Below the progress bar, u can see “5 de 10 cotas”, in Portuguese, 5 of 10 quotas, right?
After the number entry field that I didn´t like the UX.

Today the user insert the number of quotas available. Like this, selected 2. It´s like “pass the hat” or short-crowdfunding.

So, I´d like to have instead of a number entry field, a choice list with 1,2,3,4 and 5. But, another record could have 10 quotas so that the choice will be 1,2,3…10. Got it?

Again thx for your help.

I may not be fully understanding, but I think my earlier response still applies.

With all due respect, I guess I can read again and try some bullets.
The point is that will the user is insert the number of quotas he wants, I dont have any column like uu started.

NumCotas ( # of quotas)
CotasBloqueadas (purchased shares)
CotasGeradas (Generated Cotas - but here is just a number that I’m gonna use to calculate the price of one share/quota)

So, I´d like to take the field NumCotas and create a choice with 5 elements. But this number of quotes is not fixed. Depends on the total amount it could be 5, 6, 7…

How could I take one number and create a dynamic choice?
I guess u r thiking that I have the quotas info in another tab, so I could follow your instructions.

Again thx for your help.

Yeah, I guess I’m not quite understanding.
Your screen shot shows a value of 1 in the NumCotas column.
What other possible values would you expect in this column?
And what should be the resultant choices for each value. eg…

  • If the user enters 1 as NumCotas, the choices should be …
  • If the user enters 2 as NumCotas, the choices should be …
  • etc
  • etc

I think what I’m not understanding is the logic that needs to be used to determine the possible choices. If you can help me understand that, then probably I can help you find a solution.

Okay thx again. I’m looking for on Youtube as well.
Let me try to explain in another way, in order to find the solution.

“Your screen shot shows a value of 1 in the NumCotas column.”
Yes, this is the last number I inserted to purchase one quota of this record.

“What other possible values would you expect in this column?”
Each record will be diferent number of available quotas. So, the user will allow to purchase (Generated_Quotas - Purchased_Quotas)
In this example, u r seeing number one. Suppose that later I´d like to purchase 2 more quotas. When I open this doc/record I’ll see the number one. I´d like to see empty.

"And what should be the resultant choices for each value. "
If the number of available quotas is 5 the choice will be “1,2,3,4,5” then I purchase 2 quotas.
so that the available quotas now is 3 (5-2). the choice now will show “1,2,3” because I can only purchase 3 quotas, and so forth. Got it?

Oh, right.
So all you need to do is create a column somewhere (anywhere) and fill it with the numbers 1-5. Then use that column in your choice component and filter it according to the maximum available quotas. ie. “number is less than or equal to available quotas”

As far as clearing the user specific value goes, I still don’t understand why you can’t do that as part of the action sequence that opens that screen?

Thx so much for your patience. I’m gonna try to change the objects that I share the solution.
I’m gonna share de app as soon as I finished.

For our knowledge base, I’m gonna take the number entry to the after form button click, instead of before.