In Switch activity, how to match the file name read in a folder with the queue item?

@Karunamurthy

Then you dont need a switch activity at all…whatever you are getting from queue say file 1 …use that filenmae ditectly in your activities instead of hardcoding and the same code would work with all files

Cheers

Get filename from queue item and split it Nd compare in switch cases then control will goes to matched condition.

Thanks,
Suresh.

@Anil_G,

Ok, but each file has different tasks to perform and it varies each day when the automation is run. How do I code so that each time it follows the order as per queue and completes the task. First ABC then DEF, GHI, etc.,

Any help, please?

Sorry, if I am confusing you.

Regards,
Karuna

@Karunamurthy

you mean if 20 files are there there will be 20 different tasks and tomorrow again 20 new files and 20 more different tasks?

if so then you cannot…it needs to be repetitive and rule based

When you say tasks what ki d of tasks?

cheers

@Anil_G

To be more clear. There are 20 fixed files with specific task for each file. One day we might 5 out of the 20 files and other day we might have 2 files out of 20. Therefore, any day based on any number files of those 20, the specific task should be performed.

Regards,
Karuna

@Karunamurthy

So in your case statement if all task are differnent for each file a different case has to be created…so you need to have 20 cases in the switch activity

cheers

@Anil_G

So the code in the expression of the switch activity should be like:

If(Name.Equals(in_Transactionitem.SpecificContent(“Name”).ToString),“ABC”,“DEF”, “GHI”…)

Am I correct?

@Karunamurthy

If the name in queue item is already ABC then expression should be in_TransactionItem.SpecificContent("Name").ToString

I guess this is what you have in name

cheers

Hi @Anil_G

I think that “in_TransactionItem.SpecificContent(“Name”).ToString” might work but I am getting the below error:

Any help on this?

Thank you so much for your continuous help!

Regards,
Karuna

@Karunamurthy

As per error the key you hgave that is Name is not correct…can you give the correct key that you added in the queue

Cheers

Hi @Anil_G

This is key value in the config file:

image

Kind regards,
Karuna

@Karunamurthy

This is the queue name …I am taling about the specific content details you provided in the queue…

If you open queue item in orchestrator you will see it

Cheers