Solved

Email Trigger emailSubject

  • 27 February 2024
  • 16 replies
  • 101 views

Badge +2

Hi,

I have triggered a bot trough email, but if I try to retrieve subject from the email that triggered the bot, the key is blank:

Can anyone help me how to correct this behaviour?

Thanks

icon

Best answer by Zaid Chougle 7 March 2024, 04:48

View original

16 replies

Userlevel 4
Badge +14

@CorraCastel , try assigning the output to dictionary variable and after that try accessing it.

 
Userlevel 4
Badge +14

Hey @CorraCastel , were you able to find any solution of your problem?

Badge +2

Hi @Zaid Chougle ,

I have tried but in the trigger system it is not possible to use a dictionary variable. I can choose a record  variable but it does not recognise the key 'emailSubject' 

Userlevel 4
Badge +14

Hey @CorraCastel , 

Please check the link : Link.

AS you want to extract the subject of the emails you can use the loop, for each mail in a mailbox and the output of that loop is a dictionary variable and to extract the subject the key is “emailSubject”

For example: The dictionary variable you created is: email.

Then you can access the subject by: email{emailSubject}.

Let me know whether it worked or not. 

Badge +2

Hi @Zaid Chougle ,

I was hoping there was an alternative way considering that the trigger returns me the ability to use keys without loop.

Userlevel 4
Badge +14

@CorraCastel , Can you please share your exact scenario of what you are trying to automate.

So that we can make a efficient solution out of it.

Badge +2

Hi @Zaid Chougle ,

I am trying to trigger a process when I receive a certain e-mail.
When this happens my task launches a task via API which executes the process.
I wanted to avoid looping over the mails as it is already done in the task called by the API.

 

Userlevel 4
Badge +14

In my Control room :

Assigning to record variable and then passing the key: emailSubject

 
Badge +2

Hi @Zaid Chougle ,

thank you for your reply. Your answer is what I did in my Control Room:

  1. Define the Email trigger with Record variable
    1. Recover the key from Record variable
       

      Unfortunately, the task fails with error “Key 'emailSubject' not found in record.”

Userlevel 4
Badge +14

@CorraCastel , let me also test it from my end. Will update you

Userlevel 4
Badge +14

Hey @CorraCastel ,

I tried with the same approach and got the output :

 

 
Badge +2

Hi @Zaid Chougle,

could you also show me the lower part of the command “Email trigger”?

Thanks,

Userlevel 4
Badge +14

Hey @CorraCastel ,

I did the same thing but my Check every was 10 seconds.

Other than that everything is same.

 

Userlevel 4
Badge +14

Additionally @CorraCastel can you please share our trigger and below action screenshot if that is possible

Badge +2

Hi @Zaid Chougle,

I solved. The problem was related to how I managed the record variable. I was trying to extract it when it should always be used as a record.

 

Thanks for the support

Userlevel 4
Badge +14

No issues @CorraCastel . Happy to help

Reply