How to add a field from on table to another usign "Make changes to a thing?"

Hello everyone. Thanks for helping me.

I’m having a problem with “make changes to a thing”. The problem is the following:

I have a table called “merchantClientUser”. This table stores all the user data.

On the other hand, I have the “merchantProduct”. This table stores all the product data.

In order to show my customers (the merchant) how many clients they have, I need to “add” a column from merchantClientUser called “productId”, which refers to the merchantProduct unique Id.

But for some reason, I can’t make the change to the thing and I don’t know why. Look…

image

In “productId field” I’m searching for merchantProduct to join with the unique id of this one. But, why it doesn’t happen?

Honesttly I don’t know what I’m failing for…

Thanks again, folks.

Disclaimer: The productId data type is merchantProductId, so it has to “copy” the field’s data from it, am I right?

image

Hi, Bruno!

So, let me see if I got it.

You have a User table (merchantClientUser). On this table you have a column called “productId”, that refers to all the products the user has under them.

Now, on your “MerchantProduct” table, do you have a column that references the User? This “unique id” that you are using in the MerchantProduct search is the unique id of the MerchantProduct?

Do you mind sharing the structure of these two tables?

Thanks for replying to me, stela.

The productId column refers to all the product the user has in relation to, as you said.

Yes, in merchantProduct I have a column that references the user, called clientId, as you see below

Yes, it is the uniqueId of merchantProduct table.

The basic structure of these two tables is the following:

No problem, hope I can help!

So, shouldn’t the constraint on the MerchantProduct search be “merchantClientUserId”? Since you’re getting a merchantClientUser unique id.

It might be true I think, but i tried and nothing changed.

First, I tried as you said. in the 3rd step, I put the following constraint:

I think this approach may have one problem. On the first field of this image “clientid”, I put it on the merchantProductclientId, as you can see in the image bellow:
image

So I tried on the 1st workflow, where I edit the merchanClientUser table. As you can see below…

But it not worked too. So I’ll test to count the clientId from merchantProduct to evaluate the # of customers the merchant has. It seems to be a way to it

So what I meant is that this circled (red) constraint should be merchantClientUserId = This merchantClientUser’s unique id.

Then on the orange circled one it should be "productId = search for MerchantProducts:first item’s unique id.

But I’m confused as what you’re looking to do. Because if you save it this way, you will just save a new productId on your merchantClientUser table. If you want to see all the productIds related to your merchantCLientUser, the producId should be a list. This way you could “add” a productId to the list. And then you could only count how many productIds that merchantClientUser has.

If that’s the case, you can solve it doing this idea you talked about on the end of the post. You can count how many merchantProduct you have with the clientId of a specific merchantClientUser!

If that’s not what you’re searching for, then I probably didn’t understand!

This topic was automatically closed after 70 days. New replies are no longer allowed.