How to know the item number in a Dynamic List.
I have something or need to use the Counter API ?
If it’s necessary the Counter API can I have a sample.
Thanks, Mario
How to know the item number in a Dynamic List.
I have something or need to use the Counter API ?
If it’s necessary the Counter API can I have a sample.
Thanks, Mario
I am sorry but I do not understand this question. Could you ask with an example maybe?
Print it out with Print block (in Text category).
OK, this is a Dynamic List of items:
When you press “Listado Switches” download from a service the list of 3 light switches.
At the codeless side I need to send the item number = “ID” to the API. At the sample is #2 (number two) fixed but should be the number 3 of the list (equals 0, 1, 2).
I need to replace
with something represent the variable of the cell I’m clicking any of this function buttons:
Thanks, Mario
When you get the light switches from a service, iterate over the collection and assign ID to each light switch. Then in the onClick event of your button, you will get something that looks like this (it will have the name of your container):
That block will contain the property and value which you assigned when you iterated over the results of service.
Yes perfect but I need the number of the ID of the collection. The position numer 0 or 1 or 2 just the number can I find it?
Are you saying when you get the results from the service, each item already has an id?
I need the id, yes because that info is not at the array. How can I know? What id the user is selecting?
If the response from service does not include id for every switch, you need to assign IDs yourself. How to do it, I described here: How to know the item number in a DynamicList - #7 by mark-piller
OK, good idea I will make a loop asking for some data to compare with an ID counting +1 starting from 0 ! Thanks!