Skip to main content
Answer

Email Trigger emailSubject

  • February 27, 2024
  • 16 replies
  • 220 views

Forum|alt.badge.img+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

Best answer by Zaid Chougle

Hey @CorraCastel ,

I tried with the same approach and got the output :

 

 

16 replies

Zaid Chougle
Navigator | Tier 3
Forum|alt.badge.img+17
  • Navigator | Tier 3
  • February 28, 2024

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

 

Zaid Chougle
Navigator | Tier 3
Forum|alt.badge.img+17
  • Navigator | Tier 3
  • March 5, 2024

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


Forum|alt.badge.img+2
  • Author
  • Cadet | Tier 2
  • March 5, 2024

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' 


Zaid Chougle
Navigator | Tier 3
Forum|alt.badge.img+17
  • Navigator | Tier 3
  • March 5, 2024

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. 


Forum|alt.badge.img+2
  • Author
  • Cadet | Tier 2
  • March 5, 2024

Hi @Zaid Chougle ,

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


Zaid Chougle
Navigator | Tier 3
Forum|alt.badge.img+17
  • Navigator | Tier 3
  • March 5, 2024

@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.


Forum|alt.badge.img+2
  • Author
  • Cadet | Tier 2
  • March 5, 2024

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.

 


Zaid Chougle
Navigator | Tier 3
Forum|alt.badge.img+17
  • Navigator | Tier 3
  • March 6, 2024

In my Control room :

Assigning to record variable and then passing the key: emailSubject

 

Forum|alt.badge.img+2
  • Author
  • Cadet | Tier 2
  • March 6, 2024

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.”


Zaid Chougle
Navigator | Tier 3
Forum|alt.badge.img+17
  • Navigator | Tier 3
  • March 7, 2024

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


Zaid Chougle
Navigator | Tier 3
Forum|alt.badge.img+17
  • Navigator | Tier 3
  • Answer
  • March 7, 2024

Hey @CorraCastel ,

I tried with the same approach and got the output :

 

 

Forum|alt.badge.img+2
  • Author
  • Cadet | Tier 2
  • March 7, 2024

Hi @Zaid Chougle,

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

Thanks,


Zaid Chougle
Navigator | Tier 3
Forum|alt.badge.img+17
  • Navigator | Tier 3
  • March 7, 2024

Hey @CorraCastel ,

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

Other than that everything is same.

 


Zaid Chougle
Navigator | Tier 3
Forum|alt.badge.img+17
  • Navigator | Tier 3
  • March 7, 2024

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


Forum|alt.badge.img+2
  • Author
  • Cadet | Tier 2
  • March 7, 2024

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


Zaid Chougle
Navigator | Tier 3
Forum|alt.badge.img+17
  • Navigator | Tier 3
  • March 7, 2024

No issues @CorraCastel . Happy to help