How to get the id of the user and the ad in a list with the Dynamic Components extension

Hello!

My app has a list of ads with data from MYSQL. It assembles the list using the Dynamic Components extension.

I need to get the id of the user and the ad to display the details of this ad on another screen or add it to the favorites.

I am not able to solve this, since the id of the dynamic components are not the same sequence as the user ID or the ad, nor can I consider doing it this way.

For example, when the user clicks on add to favorites, I need to get the id of the user who owns the ad and the ad.

Does anyone suggest me a way?

Yes you have to detect user and Id of ad and save them somewhere to manage this data . I don’t know how you get user and how you store them but for Id I think you have to see here :point_down:t2:

1 Like

Hi, I saw this post, but I couldn’t find a solution with this. Thanks.

You tried the code I posted to you ?

Yes. But the id of the dynamic components are not the same sequence as the user ID or the ad from Mysql (primary key).

Can I see the code for dynamic component? Probably you can modify it to create component with the same ID of the ad

I’m not sure because never used schema but I think you have to modify number in the code . Call a list of Id and save them in a variable. When schema starts use select list item in list (list of ID) and index (number) and not the only number . Id of ads are a number or also letters ? If it’s not a number we have to try something different

It is number. I understand, I will try it, thanks.

1 Like

I think your suggestion will work. I am going to try. Thanks.

1 Like

Great, tell me if you will fix it :muscle:t2:

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