Skip to main content
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested answer

Slugs not working as expected in agent scripts

(0) ShareShare
ReportReport
Posted on by

Hi,

I'm trying to create some agent scripts.

and I try a simple step , a text instruction step. 

with this code:

Subject: {anchor._subjectid_value@OData.Community.Display.V1.FormattedValue}
{anchor.title}
{anchor.incidentid}


{$odata.incident.prioritycode.?$filter=incidentid eq '{anchor.incidentid}'&$select=prioritycode}

{$odata.incident.title.?$filter=incidentid eq '{anchor.incidentid}'&$select=title}

which results this:

Subject: Product

question about the product

b9aaee53-fb28-488d-a8a1-098bc3e97838

{$odata.incident.prioritycode.?$filter=incidentid eq 'b9aaee53-fb28-488d-a8a1-098bc3e97838'&$select=prioritycode}
{$odata.incident.title.?$filter=incidentid eq 'b9aaee53-fb28-488d-a8a1-098bc3e97838'&$select=title}

the first 3 slugs commands are parsed properly.

but the odata accesses return the slug tag and not the slug evaluated value. 

I can see in the console log that the slug command call the CRM, retrieve the prioritycode and title fields, but at the end what is displayed to the end user:

{$odata.incident.prioritycode.?$filter=incidentid eq 'b9aaee53-fb28-488d-a8a1-098bc3e97838'&$select=prioritycode}
is it a bug?
  • Jerome P1 Profile Picture
    on at
    RE: Slugs not working as expected in agent scripts

    thanks.

    I tried that.

    its not working the caseId is not replaced by the value.

    but my problem is that :

    the slugs expression '{anchor.incidentid}' is correctly resolve and returned.

    than the parent slug expression

    {$odata.incident.prioritycode.?$filter=incidentid eq 'b9aaee53-fb28-488d-a8a1-098bc3e97838'&$select=prioritycode}

    is also resolved (I opend the debug console and saw the values properly solved)

    but...

    the final output displays the expression itself:

    {$odata.incident.prioritycode.?$filter=incidentid eq 'b9aaee53-fb28-488d-a8a1-098bc3e97838'&$select=prioritycode}

    instead of the result of this expression, which should by "high" in this case.

  • Suggested answer
    Nya Profile Picture
    29,060 on at
    RE: Slugs not working as expected in agent scripts

    Hi,

    Please try the following expressions:

    • {$odata.incident.prioritycode.?$filter=incidentid eq '{caseId}'&$select=prioritycode}

    • {$odata.incident.title.?$filter=incidentid eq '{caseId}'&$select=title}

    {caseId} is the unique ID of a case. The system displays the case ID only if the case is linked to the conversation.

    Ref - Use automation dictionary to pass parameter keys | Microsoft Docs

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

News and Announcements

Now Available: 2025 Release Wave 2

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 51 Most Valuable Professional

#2
Ramesh Kumar Profile Picture

Ramesh Kumar 42

#3
David Shaw_UK Profile Picture

David Shaw_UK 27

Featured topics

Product updates

Dynamics 365 release plans