Dynamically update rows in same table

Hello.

I would appreciate helping with solving this scenario:

I have a table with Sales order number.

And sometimes Credit Order has to be created for Sales Order. I do this by creating a new record - credit order - and from dropdown I select the Sales order, which needs correction and here I add additional info.

When saving this record I would like to dynamically update the original Sales Order, for which the correction was just made by creating this  Credit Order.

I would need the workflow to find in table this exact Sales order number and then update or add additional info, which was created in Credit order.

I hope it makes sense.

Thank you.

Solved Solved
0 8 577
1 ACCEPTED SOLUTION

Hi @David_H1 ,

Thank you for more details. A few things,

  1. In the example of two rows in tabular format you have shared, the column key in both the records is 1111. I hope it is a typo. The key cannot be same for any two records. Also I hope column key is the key column of the table and not some other column,
  2. If [column key] is the key column of the table, then the below mentioned expression for the referenced rows should NOT work.

    @David_H1 wrote:

    2. Second action "Update SO with CO INFO" execute an action on set of rows and in Referenced Rows I have this formula:

    SELECT(Main[Credit Order],AND([Sales Order]=[_THISROW].[Correction], [_ROWNUMBER]<>[_THISROW].[_ROWNUMBER]))


    This is so because the referenced row action (  execute an action on set of rows) expects a list of keys and not any other list. The expression should be something like 

    SELECT(Main[Column key],AND([Sales Order]=[_THISROW].[Correction], [_ROWNUMBER]<>[_THISROW].[_ROWNUMBER])).   I had requested to create an expression with key column as below.

    @Suvrutt_Gurjar wrote:

    SELECT(Table Name[Table Key],AND([Sales Order Number]=[_THISROW].[Sales Order Number], [_ROWNUMBER]<>[_THISROW].[_ROWNUMBER]))



    3.  The below action expression will also not work.


  3. @David_H1 wrote:

    1. First one "Update Sale Order with Credit order Info" where I set the values of some columns in this row:

    Credit Order = [_THISROW].[Credit Order]
    Notes = [_THISROW].[Notes]


    I had requested a SELECT() expression as below.

    @Suvrutt_Gurjar wrote:

    Your SELECT() expression to update the column value can be something like 

    SELECT(Table Name[Column Name],AND([Sales Order Number]=[_THISROW].[Sales Order Number], [_ROWNUMBER]<>[_THISROW].[_ROWNUMBER]))



    So your expression to change [Credit Order] can be 


    ANY( SELECT(Table Name[Credit Order],AND([Correction]=[_THISROW].[Sales Order], [_ROWNUMBER]<>[_THISROW].[_ROWNUMBER])))

    Edit: Added ANY() to he expression.
  4. Finally it is not exactly clear , how you are initiating the referenced row action. Presume you are doing it as a "Form Save" event action.

Hope this helps.

View solution in original post

8 REPLIES 8
Top Labels in this Space