Comparing multiple string values

I want to compare multiple values to see if they have the same string value to see if a customer already exist within the system and if that data matches. If it doesnt match then I can update the data.
I currently have an absurd amount of decision making in a flow in the image.
I’m wondering can I write a small code block to manage multiple “if” statements instead of design an ugly flow chart.
Any help with writing the code block would be helpful as well.

@michael.p.wilson

I can see a perfect scenario for a switch flow. Instead of multi decisition activity you can replace them with single switch activity.

If you are not aware of switch flow activity or your use case differs then revert back.

Good Suggestion!

Hello @michael.p.wilson,
you could create this logic as a separate workflow by parsing arguments. I think Flow chart would be the better solution and you are in the right track. check the below post.

HI @michael.p.wilson

Just curious to know few things… In your workflow, you have multiple decision nodes to check AccountName1, AccountName 2 and so on… So I would like to know, whether you have various activities to perform if either one of those is not true?

For example, you check for accountName1, if true check for accountName2. If account Name 2 is not true, do you have separate set of tasks to run? If not, I think the Switch Flow activity is the best suitable for your scenario instead of having multiple decision activities…

One suggesion, Why don’t you try having all those conditions in one IF condition if you do not have any other conditions to check in each of those decision activities like i explained above?

So basically this flow chart is inside a another flow and the information is retrieved from a data source filled in from the customer. Before we create a new account in the system we use a unique business number called an ABN (Australian Business Number) given by the customer to check if it already exist. If it doesnt exist we create a new account.
So this process starts when ABN already exist, the bot now needs to check whether the details from the customer match the data in the system. If it all matches then we use the system data. If there is an update required the bot needs to compare all the data find which piece of information doesnt match, e.g. new bank details, new address and then create a log file save the new input to the data source and update.
So basically it needs to check every bit of information and match it to the system and if its all not a positive match then update that particular string in the data file

Hi @michael.p.wilson

Now i get the idea… so this is what you need to do…

In your flowchart, first start off with a decision activity to check whether the customer exists using the ABN number you mentioned. If the customer exists, under the true branch, add a invoke workflow activity and invoke another workflow. In that workflow file, have all your data comparisons one by one to check which attribute of that person does not match. As a output of that you can return which attribute (ex: bank account) does not match to the main workflow using the arguments. Once returned, you can do the update depending on which attribute should be updated… if you can return all the mismatching attributes in an array, you can loop through them and do what ever it needs to do may be by using a switch flow activity.

And under the false branch of the ABN decision node, you can use another invoke workflow to invoke another workflow to create the new record.

This way, you break your entire flow into three different files.

  1. Main workflow where you control what to do based on the ABN exist condition
  2. Workflow used to compare the record and to return which attribute to be updated if anything is not matching
  3. Workflow to create a new record if it doesnt exist
  4. If possible.you can add another workflow to update the records if they do not match

Hope it helps

1 Like