Digital Exchange

last person joined: yesterday 

This community is a place to discuss Blue Prism DX assets and development.

Expand all | Collapse all

how to call a function from global stage to code stage?

  • 1.  how to call a function from global stage to code stage?

    Posted 08-13-2019 14:50

    I have written a function to iterate through the folders in outlook to retrieve the sub folder and download the attachment. the recursion function has been written in global code stage of initialize page and the main program i calling the function. What i want to understand is whether the code stage acts as a main() function? if so, then it should invoke the function which it is not.

    I have written the recursion in global code. MultipleID m = new MultipleID(); MultipleID is the name of the object.

    //initialize page code:
        public string folderPath =@'\	est	est1	est2';
        public string subject ='test exist';
    //path to save the attachment
         public path =@'C:	est';
         public void ProcessFolder(MAPIFolder folder)
              foreach(MAPIFolder subFolder in folder.Folders)
                  if(subFolder.FullFolderPath == folderPath)
    //code stage
        MultipleID m = new MultipleID();
        string EmailID = '';
        Microsoft.Office.Interop.Outlook.Application app = new 
        Accounts acc = app.Session.Accounts;
        NamesSpace ns = app.GetNamespace('MAPI');
        Folder folder = app.Session.DefaultStore.GetRootFolder() as Folder;
         Microsoft.Office.Interop.Outlook.Stores stores = ns.Stores;
        foreach(Microsoft.Office.Interop.Outlook.Store store in stores)
         if(store.DisplayName == EmailID)
                MAPIFolder inbox_folder = 
    Disclaimer: This content was auto-posted from Stackoverflow. The original Stackoverflow question is here Stackoverflow Post, posted by Ankita Mohapatra.

  • 2.  RE: how to call a function from global stage to code stage?

    Posted 09-24-2019 07:55
    Hello Ankita,

    Thank you for using Blue Prism and your question.

    The global stage acts as a kind of repository for your own code such as classes and methods. The idea being that your code can then call those routines in your own code stages. You say that your ProcessFolder method is not being called. Can I ask, is there any possibility that an exception is occurring before it is getting there? My thoughts are a possible stack overflow, given we are talking recursion here.

    My suggestion to you to assist in any debugging is to wrap a try-catch around your code and then add a temporary output text parameter to your code stage and catch the Exception.Message value, should there be one. This value can be assigned in the catch area.

    The other matter could possibly be a security issue that outlook is detecting it is being used outside of its own process and is perhaps protecting itself. This is only a suggestion and not a definate statement of what could be happening.

    I hope I have at least helped further your understanding of  the situation.

    Once again thank you for using Blue Prism and being part of the community.

    Geoff Hirst
    Partner Pre Sales
    Blue Prism

Welcome to the Blue Prism Digital Exchange Community!

The Blue Prism Digital Exchange is a "shop window" for new and emerging technologies—a platform that puts powerful RPA and AI capabilities into the hands of business leaders. Users can find and apply pre-built AI capabilities, in the form of downloadable integrations and Visual Business Objects (VBOs), to automated processes. These assets connect and integrate Digital Workers, existing systems and processes to Blue Prism's technology partners, creating a solid foundation of AI-enabled Intelligent Automation that's scalable and sustainable.

Blue Prism Digital ExchangeDX Asset IdeasContact DX Support


The Blue Prism Digital Exchange (DX) is an online marketplace where businesses can instantly access, apply and share pre-built AI, cognitive and advanced RPA technologies from best-in-class providers. These assets easily connect to existing digital workers, systems and processes to enhance automation capabilities.
The Digital Exchange is free to all users. Most of the content on the DX is free to download but there are some submissions that do have a cost associated. The submissions with a cost are advertised on the asset card and profile. No unwanted costs will be applied to any users.
You can visit and browse the Digital Exchange here. If you would like to consume or download any material it is necessary to create an account on the Blue Prism Portal first.
Everyone can access the Digital Exchange and consume the assets on it. If you would like to contribute to the marketplace it is necessary that you create an account and sign up as a partner.