I have a Workflow that inserts a new Row into a Data Table based on a users input.
→ User submits training record with date completed and this is recorded in a Training Register Table (in a new row/record) *This needs to be a new row/record
The workflow then creates a new row/record in a separate data table (Training Status) which tracks the date and relevant quarter.
The issue I have is the user may already have an entry (record/row) in the Training Status Data Table from a previous training record that fell within the same quarter period.
So, is there a way (If Then Else or similar ?) where an exisiting row (for that user and that quarter) in the Training Status Data Table could be searched, found and updated within the workflow (if a record/row for that user and quarter already exists) THEN update the specific columns… or if no record/row exists , create a new one ?
The answer is yes, but before I offer a solution I have a question: are you using a user interaction workflow, or a server-side workflow?
The answer is important, because the solution will be different in each case.
Hi Darren, pretty sure it is a ‘user interaction’ workflow as it is triggered by user input.
This is what is currently there:
I hope to be able to include a step before the ‘to Training Status’ add row that searches the Training Status data table for reference to user and period (quarter) and updates the relevant columns in the row IF an entry exists before going on to the ADD row as part of an ELSE string ?
*For some reason I cant seem to be able to add a condition AFTER the second step ?
Yes, and it looks like you are using it as an onSubmit action with a Form Container, yes?
Correct. That can only be done with server-side workflows.
What you will have to do is determine whether a matching row already exists in your Training Status table before the form is submitted, and then you can insert the condition at the top of your workflow. One branch will add a new row, and the other branch will update the existing row.
One way to do that is to switch to a Custom Form, but perhaps in this case and easier approach would be to write the appropriate form values to your User Profiles row. Then use them to create a relation or query to your Training Status table, and use the status of that relation in your workflow condition. ie. if empty → add row, if not empty → update row.
Is there a way to have 2 different data sources within the same workflow or is a 2nd separate workflow required ?
IE the Training Register Row interaction is sourced from the Training Registration data table.
But I need the Configure/d action to link to the Training Status Data Table (display/show Training Status Data Sheet Columns to select which ones to check and change).
If I insert a new Add Condition before the step 2 (show notification) it is linked to the Training Register Data Table (source) ?
Is there a way to insert the condition but have it linked to the Training Status Data table (source) as this is where the row needs to be modified (if pre-existing) or a new row inserted if none exists ?
*Or could it be achieved by adding a Trigger Workflow to the current workflow ?
Another possible option is to leave the workflow as it currently functions (which creates multiple duplicates) and instead look at a way to identify the duplicate entries within the Data Table and then bulk delete (duplicates only) ?
IE Step 1: Set up duplicate detection then Step 2: Create deletion workflow
A little counter intuitive but could be a whole lot quicker and easier ?
If you follow the earlier suggesting that I gave you, then you can update the appropriate row in the Training Schedule row via the relation in your User Profile row. It doesn’t matter that the workflow is attached to the Training Register table (that’s precisely why I suggested writing the form values to the user profile row).
Ah yes ! Apologises, as that took a little long to sink in at this end !