Expression for dereference

Hello, I don't know if it is possible, but some wise friends may know how to accomplish that.

I want to pull the the value of image column of my "product" table to my "orders" table's image column. I made a dereference, and it is working. However, when the value of image colum in the products table is blank the orders table image column doesn't show up.My purpose is, to add an image to the product table image column updating directly from the orders table image column. 

Any help appreciated much.

0 22 310
22 REPLIES 22

If you wish to dereference the image from the Products table into your Orders table AND make sure that it stays in sync with any changes made in the Products table, then you have no choice but to place your dereference expression into the App Formula property of your Orders table image column.

Assuming you do need the above, to update the Products table image from the Orders table, you will need a separate column.  Only show the column when the "usual" image column is blank allowing a user to add an image.  You will need to also add an action that copies this new image over to the Products table.

I hope this helps!

 

I will add a second column two products table. When users select products and if it doesn't have pictures for the product, the 2nd column will show up and the users should add an image to this required field. So far so good. Then I should make an action to pull the values from 2nd column to the original one.
Thank you

Dear @WillowMobileSys,

I end up adding the 2nd column to the orders table. But I couldn't make the expression to get values that match the product ids from the order table's second column to the products table in 1st column. 

Re-reading my post, I was not very clear. 

The idea was to add an image from the Orders table that will ultimately be copied back into the Products table when there is no Products image to show. 

To provide for that feature, you would add a second image column into the Orders table.  This new column is Editable and would only show if the dereference image form the products table is blank (as you noted when blank, it is hidden anyway).  

With this new column showing on the Orders Form, a user can add the appropriate Product image and when the Order is saved, you will then need to include an action the copies the image back to the Products table.

It is at this point, I am thinking, that you are saying you are not certain of how to match up the newly entered image on the Order Form with the correct Product row.  Is that correct?

If so, then you need to show us what you have so far, where you are attempting to add an image and where you are seeing/having the issue.


@WillowMobileSys wrote:

you will then need to include an action the copies the image back to the Products table.


Yup! For that, I am trying to create action but I didn't find the proper expression to compare the list in enum type ref-based list, I share the screenshots below. 

 

Atlas_1-1663451902323.png

Atlas_2-1663451925946.png

 

 

 

What you have won't work.  First, your Image column accepts only a single item but the expression implemented implies a list - when you insert something like

[Table Name][Column Name]

...with no spaces or periods in between, the return is a list of the Column Name values from the "Table Name" table.

I think you were attempting to dereference but probably got an error.  That is because the dereference will not work in the direction you are trying. 

To get the image from the other table you will need to use a SELECT() expression from what I am seeing.  It would be something like this:

ANY(SELECT(Talepdetay[Resim], [Malezeme Kudo] = [_THISROW].[Malezeme Kudo] ))

This returns a SINGLE image and assumes there is only a single row in the table Talepdetay with the same value in the [Malezeme Kudo] column.  If there is more than one row, you may need to make some adjustments.

Thanks Willow! The expression is working. I made it with Lookup exprssion

 

LOOKUP([_THISROW].[MALZEME KODU],"TALEPDETAY","MALZEME KODU","RESฤฐM")

 

I have a button now that works manually, but I couldn't make the automation using "Data: execute an action on a set of rows" . It gives an error below. Also it gives the same error with AnySelect expression. I am not good at programming just learning.

Atlas_0-1663499253140.png

 

Yes LOOKUP() can replace the expression I provided but it will return only a SINGLE VALUE.  They way you have your tables setup, it seems you might expect there to be multiple rows with images.  You would then use a SELECT() so you can taylor how the single row you want is chosen.

To correct your error, use the expression I gave but remove the ANY() function. 

SELECT(Talepdetay[Resim], [Malezeme Kudo] = [_THISROW].[Malezeme Kudo] )

Again, I caution about multiple rows with the same value in the [Malezeme Kudo] column.   If you do have that case, you will get multiple rows executed by the action.   It may be what you want just thought I'd make you aware of it.

I want users to add an image to "orderdetails" form if there is not a default image in the products table for the related item. After saving this order form, it needs to be updated in the products table. For future orders, I don't want users to add different pictures. 

I tried every version of the expressions we discussed both within two action behavior. But I am totally lost. Still searching for a solution, or a different way of approaching accomplishing my purpose. 

The value '=SELECT(TALEPDETAY[RESฤฐM],[MALZEME KODU]=[_THISROW].[MALZEME KODU])' of data action 'RESฤฐM > FOTOฤžRAF' does not match the expected type List or its expected type detail

Atlas_0-1663502496134.png

Atlas_1-1663503291783.png

 

 

Sorry.  I was focused on the usage of LOOKUP() and didn't pay attention to what property you were using the expression in.

When creating an expression for a Referenced Rows property, as in the action above, the expression MUST return the row keys of the rows from the Reference Table.

In other words, in your "GET COPY VALUES" action, the Referenced Rows property must return a set of row keys from the URUNLER table...:

SELECT(URUNLER[Row Key Column],  <<some criteria for selecting the rows)

Replace "Row Key Column" with the name of the Key column from your URUNLER table and then add whatever criteria you need to select the rows. 

Thank you for your kindness and all your replies.  I made the bot, with no errors and it is working!

But there is a little issue with the automation bots, the value returns with the table name in front of the value. "TALEPDETAY::" shouldn't be there.

TALEPDETAY_Images/7b5497b4.RESฤฐM.004948.png

TALEPDETAY::TALEPDETAY_Images/ddc17b48.RESฤฐM.092948.jpg


@Atlas wrote:

TALEPDETAY::TALEPDETAY_Images/ddc17b48.RESฤฐM.092948.jpg


Where are you seeing this filename?

On the products(URUNLER) table. 

Atlas_0-1663550060014.pngAtlas_1-1663550063899.png

Hope this helps for better understanding. 

And the values are being written in the URUNLER table by the "Copy Values" action with this expression below?

ANY(SELECT(Talepdetay[Resim], [Malezeme Kudo] = [_THISROW].[Malezeme Kudo] ))

 Since they are coming from the TALEPDETAY table, check if any of the values in that table has the the "TALEPDETAY::" value tacked onto it.


@WillowMobileSys wrote:
ANY(SELECT(Talepdetay[Resim], [Malezeme Kudo] = [_THISROW].[Malezeme Kudo] ))

Yes, the values are being written in the URUNLER table by the "Copy Values" action with this expression.
And the expression below is in the "Get Copy Values" action.

SELECT(URUNLER[MALZEME KODU],[MALZEME KODU]=[_THISROW].[MALZEME KODU])



And there isn't any ""TALEPDETAY::" value tacked on to in the TALEPDETAY table. 

Manuel execution of "Copy Values" action has no such results. I tried to configure the bot and got the same errors.

 

I think I hear you saying that the problem is only coming from when the Bot copies the images.  Can you show us the Bot and the related steps for copying...in detail...to see if wa might be able to spot the problem?

Actually, it is working in this way. Even if it got on ""TALEPDETAY::" tacked on to the original value. But it's a weird situation the get value with a tablename tacked on. 

Here is my bot configuration.

Atlas_0-1663593966431.png

 

 


@Atlas wrote:

But it's a weird situation the get value with a tablename tacked on.


Yes, I agree and I wonder if it is by design as a way to locate the image in a single storage location so that you do not have MANY duplicate copies of the same image.

I have never seen that syntax but I don't think I have ever done what you are doing.

Steve
Platinum 4
Platinum 4

@WillowMobileSys wrote:

I wonder if it is by design as a way to locate the image in a single storage location so that you do not have MANY duplicate copies of the same image.


I believe that's the case.

When I delete the syntax it still works by the way.
Thank you for your help @WillowMobileSys 

I don't know if it is possible but I should ask that.

The purpose is to ask the user to an image upload, if there is not an image in the product list that comes to the order table with dereference expression.

I made a lot of unnecessary work without knowing whether if the possibility of that "Is it possible to edit an image column if dereference value is blank?"

I would like to listen to this from the experts in our community.

Top Labels in this Space