web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Flow retrieve activity

(0) ShareShare
ReportReport
Posted on by 5,514
Hi  is the below expression is correct
 
 
 
 
 
 
Categories:
I have the same question (0)
  • Verified answer
    Daivat Vartak (v-9davar) Profile Picture
    7,833 Super User 2025 Season 2 on at
    Power Automate Flow retrieve activity Id from email link
    Hello Sandeep,
     

    Based on your description and the Power Automate expression, it might be correct if the Activity ID within the call report link in the email description is consistently enclosed within curly braces {}.

    Let's break down the expression:

    • outputs('Compose_-_Description'): This assumes you have a "Compose" action named "Compose - Description" that holds the email description.

    • indexOf(outputs('Compose_-_Description'), '{'): This finds the starting index of the first curly brace {.

    • add(indexOf(outputs('Compose_-_Description'), '{'), 1): This adds 1 to the starting index, so you start extracting the ID after the opening curly brace.

    • indexOf(outputs('Compose_-_Description'), '}'): This finds the starting index of the first closing curly brace }.

    • slice(outputs('Compose_-_Description'), ..., ...): This extracts a substring from the email description, starting from the position after the { and ending at the position of the }.


    •  

    However, there are a few potential issues and considerations:

    1. Consistency of the Link Format: This expression heavily relies on the Activity ID being always enclosed in single curly braces {} within the call report link. If the format varies, this expression might fail.

    2. Multiple Curly Braces: If there are other curly braces in your email description before the Activity ID, indexOf will only find the first occurrence, leading to an incorrect extraction.

    3. Error Handling: The expression doesn't include any error handling. If the curly braces are not found, the indexOf function will return -1, and the slice function might throw an error.

       


    4.  

    To make it more robust, you might consider:

    • Verifying the presence of both curly braces before attempting the slice.

    • Using a more specific pattern to identify the Activity ID if the link structure is more predictable (e.g., if the ID always follows a specific keyword). You could potentially use the split() function if the link has a consistent delimiter.

    • Regular Expressions (more advanced): For more complex or less consistent link formats, you could use the "Parse JSON" action with a schema designed to extract the ID using a regular expression (though this is more involved).


    •  

    To confirm if your expression is working correctly for your specific scenario:

    1. Run your flow with a sample email.

    2. Inspect the output of this expression. Does it correctly extract the Activity ID?


    3.  

    If the Activity ID is reliably within single curly braces, your expression should work.

     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more. If you have further questions, please feel free to contact me.
     
    My response was crafted with AI assistance and tailored to provide detailed and actionable guidance for your Microsoft Dynamics 365 query.
     
    Regards,
    Daivat Vartak
  • sandeepc Profile Picture
    5,514 on at
    Power Automate Flow retrieve activity Id from email link
    Any suggestions will be marked as verified
  • sandeepc Profile Picture
    5,514 on at
    Power Automate Flow expression
    Any suggestions?
     
    As this is bit urgent ..for deployment
     
    How can we retrieve activity I'd from call report link in email after sent using power automate formula 
     
    Slice

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 258

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 179

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 129 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans