Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error parsing list segments: Requested value 'EcommSpent' was not found. #621

Closed
bencurthoys opened this issue Mar 12, 2024 · 2 comments
Closed

Comments

@bencurthoys
Copy link

bencurthoys commented Mar 12, 2024

When retrieving list segments for one particular customer

ListSegment[] segments = (await mcm.ListSegments.GetAllAsync(listId, request)).ToArray();

I am getting the error "Requested value 'EcommSpent' was not found", which is evidently because it is trying to parse the "condition_type" field. When I hit the API end point in PostMan I am getting this response:

"segments": [
        {
            "id": 3157029,
            "name": "Unsubscribed segment",
            "member_count": 0,
            "type": "saved",
            "created_at": "2021-03-04T14:53:45+00:00",
            "updated_at": "2024-02-06T16:00:51+00:00",
            "options": {
                "match": "all",
                "conditions": [
                    {
                        "condition_type": "EcommSpent",
                        "field": "ecomm_spent_all",
                        "op": "greater"
                    }
                ]
            },

and "EcommSpent" does not seem to exist in the ConditionType enum.

In the ConditionType enum there is an entry

 [Description("ecomm_spent_all")]
 EcommSpentAll,

so I assume the problem is that "EcommSpent" does not match "EcommSpentAll".

Would an appropriate fix be to add EcommSpent to the enum? Or to rename EcommSpentAll to EcommSpent?

Either way, would you like me to submit a pull request with one change or the other, or would it be easier for you to do it as it's a 1 line change?

@bencurthoys
Copy link
Author

(I have worked around this with my customer by changing the condition from "Amount Spent In Total > 0.01GBP" to "Average Amount Spent Per Order > 0.01GPB", I don't care about the segment with this condition at all, I just need to get the list of ALL segments in order to find the one I do care about, and for that they all need to parse.)

Copy link

Stale issue message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant