Expected a unique ID, got 'card_1. Error dinamic component

Is this block executed more than 1 time?

Try removing the _ from the id, maybe it can work

The “_” does not cause any issues with DC. This seems to happen every time someone uses the list loop except for me?

1 Like

For each
Create component card_1
Create component card_2
Create component card_3

Again … For each

Create component card_1
Error… Already existe card_1

Remove Id Block.

This is the procedure that I use every time I want to create the list of dynamic components:

This is beacuse you create two component with one id

1 Like

If I already noticed and changed the second “for each” to “2card_” and added the 2 for all the IDs of the components of this second loop.

But it still throws me the error. This generator is the only one that I develop on this screen.

Things are crazy:

When I run this procedure it throws me the error of expected unique ID:

I use this loop to remove all IDs that were created, before running the “busqueda_por_producto” procedure again:

blocks


Now, on the other hand:

When I run this procedure, I get the error of “Attempt to invoke virtual method ‘java.lang.Class java.lang.Object.getClass()’ on a null object reference”:

What a madness !, but I feel that each time we are close to finding the solution and I thank you for your help.


NOTE: If I have the two “for each” loops and according to the amount of the global list in “to” of the “for each” is 1, that means that I do not use the second loop, (remember that to use both you have there must be at least 2 or more elements for it to be executed), it does not present any error because the second block does not execute, but if I remove the second loop and execute the procedure if it shows me the error of “an id was expected only”.

I don’t know if this produces the problem, but I think that if I fix this it may stop presenting me with at least the last .java error

The data I need to fill in the image and label components is having problems.

What I do to call that data is the following:

Here is the get value block:

imagen

As you may have already noticed, although the global value “lista_busqueda” contains (element1, element2, element3) the “for each” loop does the job for me, but it is not calling me the action of obtaining value 3 times, which would be the number of elements I have in the list the global value of “lista_busqueda”.

How can I get the values ​​of each of the elements that make up the list of the global value “lista_busqueda”?

Problem solved.

The loops were of more. When I call the values ​​that I will use in the labels and images of the dynamic components, they tell me the times in which the dynamic component will be created, so I only had to put this when executing the “buscar_por_producto” procedure:

I suggest using a scheme to minimize the amount of blocks you need. Other than that, I’m glad you could solve your issue!

1 Like

Thank you very much friend, what do you propose to me to reduce the number of blocks? Because the truth is I made a simple model and it gave me all those blocks.

You can create a schema to minimize the amount of blocks, it is written in JSON and you can create various components with just few blocks, in the Dynamic components page you can see a wiki explaining everything about the schema and how to create with writting or you can transform a aia in a schema.

1 Like

Thank you very much for the information, I did not know about this.

1 Like

I am a beginner and i am facing the same issue. But i didn’t understand the solution provided above. Can you simplify for me.

I am getting error-
Expected a unique ID, got ‘cardview_11’

What should I change?

Try :

2 Likes

I read the post but still didn’t understand what to change. How to remove IDs?

Try this

image

3 Likes

@Rogerio_Rios and @dora_paz
Thank you both.
I am finally able to use remove IDs block and it worked.

4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.