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

Notifications

Announcements

No record found.

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?
I have the same question (0)
  • Suggested answer
    Nya Profile Picture
    29,060 on at

    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

  • Jerome P1 Profile Picture
    on at

    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.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 55 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 27 Most Valuable Professional

#3
Scott Jackson UK Profile Picture

Scott Jackson UK 22

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans