In a loop i need to save a xml or excel file and use it after how can i select the good one

After getting a attachement file ( xml or excel) from a email, i need to save the file and use it after. but the process is not the same if its a xml file or an excel file, how can i select the good one

HI,

There are some ways to achieve it. How about using Switch activity as the following?

Regards,

@Yoichi
How the bot can know that is a xml file ?

@Soudios

By using the extension as mentioned by @Yoichi

Cheers

@Yoichi @Anil_G

I have this issue : System.IO.Path.GetExtension(CurrentPieceJointe)

Questions :

The output of save attachment its what i need to put in list of item ?
What is the variable type of strExt ?

Hi @Soudios

Please make the variable type of File extension as string also the CurrentPieceJointe type should be string.
The output of save attachment is of type System.Collections.Generic.IEnumerable<System.String>

@rashmisingh2695

The variable in list item is the output of save attachment ? or i need to create a new one ?

And What is the variable type of strExt ?

strExt is of type string
You need to use the list output of Save attachment activity

Like this ? When i chose string for File Extension ( strExt for Yoichi ) i have this issue :


image

@rashmisingh2695

i can’t see what you put on the propreties FOR Each

@Anil_G @Yoichi
why its not working for me ?

@rashmisingh2695 can you send me your xaml file plz ?

@Soudios

Fileextension varible type should be on type string…please change the same

And inside getextension use currentitem /currentplacejointe

Cheers

Please check this xaml and let me know if it works.
GetExtension.xaml (10.6 KB)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.