Expand my Community achievements bar.

SOLVED

Using API to create segment of segment and then try to edit Audience using Audience UI editor in AEP

Avatar

Level 1

HI Team,

 

I am trying to create Segment of Segment with same and/or condition between different segment and trying to create Streaming Segment.

Audience gets created but if in case there is bug on of the bug, i am trying to change segment/audience Using UI but it says audience not editable.

 
Below is the PQL condition for reference
Approach one : 
"expression": {
        "type": "PQL",
        "format": "pql/json",
        "value": "{\"nodeType\":\"fnApply\",\"fnName\":\"and\",\"params\":[{\"nodeType\":\"fnApply\",\"fnName\":\"or\",\"params\":[{\"nodeType\":\"fnApply\",\"fnName\":\"and\",\"params\":[{\"nodeType\":\"fnApply\",\"fnName\":\"not\",\"params\":[{\"nodeType\":\"fnApply\",\"fnName\":\"inSegment\",\"params\":[{\"nodeType\":\"literal\",\"literalType\":\"String\",\"value\":\"7d5355a0-7804-492a-92af-1a545c1be742\"}]}]},{\"nodeType\":\"fnApply\",\"fnName\":\"not\",\"params\":[{\"nodeType\":\"fnApply\",\"fnName\":\"inSegment\",\"params\":[{\"nodeType\":\"literal\",\"literalType\":\"String\",\"value\":\"9a55fc67-58ce-4fac-a5a2-9b0c93015041\"}]}]}]},{\"nodeType\":\"fnApply\",\"fnName\":\"and\",\"params\":[{\"nodeType\":\"fnApply\",\"fnName\":\"inSegment\",\"params\":[{\"nodeType\":\"literal\",\"literalType\":\"String\",\"value\":\"7d5355a0-7804-492a-92af-1a545c1be742\"}]},{\"nodeType\":\"fnApply\",\"fnName\":\"inSegment\",\"params\":[{\"nodeType\":\"literal\",\"literalType\":\"String\",\"value\":\"9a5db049-6135-40f9-8926-5d2d58ad29ff\"}]}]}]},{\"nodeType\":\"fnApply\",\"fnName\":\"inSegment\",\"params\":[{\"nodeType\":\"literal\",\"literalType\":\"String\",\"value\":\"61521ddf-b1dc-44e1-950f-6ad4efd519a8\"}]}]}"
 Below is the screenshot for reference:
ParthMo1_1-1764079722391.png

 

i am clicking on edit audience but as soon as i click on edit button it shows me below error
ParthMo1_2-1764079790834.png

can anyone help me out in understanding what changes do i need to make in Value so that it can resolve this issue and i don't have to run postman again and edit the audience directly using UI after creating through postman.

 

It works for 1 or 2 audience perfectly but as soon as i tried with multiple audience and multiple container with and/or it doesnt work.

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi @ParthMo1 ,

 

You’re not doing anything wrong with the API – this is expected behavior:

  • Segment-of-a-segment via API is supported: Using another segment in the expression and creating/updating it via the Segmentation API is fully supported. See the Segment Definitions API docs

  • But API‑created segments aren’t always editable in the UI: The visual Segment Builder can only open audiences it can safely “rebuild” from the stored PQL. Segments created purely via API (especially more complex ones, including segment‑of‑segment) may be visible and usable, but not editable in the UI. Edit for these has to be done via the API.

So the behavior you’re seeing (segment works, can be used, but isn’t editable in the UI) is a current UI limitation, not an API/segmentation bug.

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

Hi @ParthMo1 ,

 

You’re not doing anything wrong with the API – this is expected behavior:

  • Segment-of-a-segment via API is supported: Using another segment in the expression and creating/updating it via the Segmentation API is fully supported. See the Segment Definitions API docs

  • But API‑created segments aren’t always editable in the UI: The visual Segment Builder can only open audiences it can safely “rebuild” from the stored PQL. Segments created purely via API (especially more complex ones, including segment‑of‑segment) may be visible and usable, but not editable in the UI. Edit for these has to be done via the API.

So the behavior you’re seeing (segment works, can be used, but isn’t editable in the UI) is a current UI limitation, not an API/segmentation bug.

Avatar

Level 2

Thanks even i thaught the same but then thaught to confirm with community.