how to set up automation logic for move row based on field value
Hello!
I have a sheet populated by a form evaluating items identified by #'s. . There are several hundred items to be evaluated and users may fill out this form several times a year. My goal is to have the sheet showing only the most recent evaluation for each item.
I would like to create an automation so that each subsequent time they fill out the form for item #XXXX, the row containing the previous form entry for item #XXXX is moved to another sheet.
I am not sure how to set up the trigger block logic for this.
I am starting with
When Rows Are Added and Run Work Flow When Triggered
But I need to add a condition where "when the item # matches an existing one, move the oldest entry to new sheet"
but there is no option for "matches." The closest I can find is "is equal to" but I don't have a way to specify the number.
Also the "Move Row" action does not allow me to specify the older row should be moved.
Any suggestions would be very appreciated.
Thank you!
Carroll
Best Answer
-
Thanks for your reply.
I am trying to create the formula for the 3rd step in my sheet but am getting an unparseable error.
I substituted my actual column name Contract Number for Product# in your example. Smartsheet added the brackets when I clicked the column.
YOUR formula
=IF(AND(COUNTIF(PRODUCT#:PRODUCT#,PRODUCT#@row)>1,MATCH(PRODUCT#@row, PRODUCT#:PRODUCT#,0)=ROW#@row),1,0)
MINE
=IF(AND(COUNTIF([Contract Number]:[Contract Number],[Contract Number]@row)>1,MATCH([Contract Number]@row, [Contract Number]:[Contract Number],0)=ROW#@row),1,0)
Did I miss something?
Thanks,
C
Answers
-
Create the following columns:
- "LINE-ID" : Auto Number Column
- "ROW#" : Column Formula: =MATCH([LINE-ID]@row, [LINE-ID]:[LINE-ID], 0)
- "IS_OLD" CheckBox Column Formula: =IF(AND(COUNTIF(PRODUCT#:PRODUCT#,PRODUCT#@row)>1,MATCH(PRODUCT#@row, PRODUCT#:PRODUCT#,0)=ROW#@row),1,0)
Run your automation on "IS_OLD" becomes checked.
-
Hi Carroll,
Here's one possible solution.
You'll need a helper column formatted as a Checkbox column. This is where the formula will go. You'll also need the system-generated Created (Date) column.
This formula looks for duplicates of Items, excluding blanks (Countifs >1) and if there are duplicates, it looks if the Created Date of the current row equals the Minimum Created Date of the right Item numbers (gathered by the Collect function). The checkbox gets checked (the last 1 in the formula) when the Created date is that minimum - which means its the oldest date of that series.
You would set your automation to trigger with rows added or changed, and when the checkbox column is checked, plus any other conditions (if any) that are relevant to your process.
Don't forget to change the column names in the formula to match yours.
=IF(COUNTIFS(Item:Item, Item@row, Item:Item, @cell <> "") > 1, IF(Created@row = MIN(COLLECT(Created:Created, Item:Item, Item@row = @cell)), 1))
I hope this helps.
-
Thanks for your reply.
I am trying to create the formula for the 3rd step in my sheet but am getting an unparseable error.
I substituted my actual column name Contract Number for Product# in your example. Smartsheet added the brackets when I clicked the column.
YOUR formula
=IF(AND(COUNTIF(PRODUCT#:PRODUCT#,PRODUCT#@row)>1,MATCH(PRODUCT#@row, PRODUCT#:PRODUCT#,0)=ROW#@row),1,0)
MINE
=IF(AND(COUNTIF([Contract Number]:[Contract Number],[Contract Number]@row)>1,MATCH([Contract Number]@row, [Contract Number]:[Contract Number],0)=ROW#@row),1,0)
Did I miss something?
Thanks,
C
-
Try the below. You just need to add brackets around the ROW# field.
=IF(AND(COUNTIF([Contract Number]:[Contract Number], [Contract Number]@row) > 1, MATCH([Contract Number]@row, [Contract Number]:[Contract Number], 0) = [ROW#]@row), 1, 0)
-
Hello, I am trying to do a similar move. It is based on a tracking number we use. We use that tracking number (RL Number) multiple times for actions. I created the checkbox column and inserted this formula: =IF(COUNTIFS(Item:Item, Item@row, Item:Item, @cell <> "") > 1, IF(Created@row = MIN(COLLECT(Created:Created, Item:Item, Item@row = @cell)), 1))
The lines that have that duplicate have a #INVALID OPERATION instead of being checked.
I'm not sure what I am missing.
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.5K Get Help
- 402 Global Discussions
- 213 Industry Talk
- 450 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 135 Just for fun
- 56 Community Job Board
- 454 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives