question

Kim Strasser avatar image
Kim Strasser asked

Is it possible to get a catalog item's Tags in Cloud Script?

The rule is executed when a player purchases an item and my Cloud Script function is executed. But I don't get the value of Tags in my Cloud Script.

The catalog item's Tags:

The rule:

My Cloud Script function:

handlers.AddTicketPlayerTag = function (args, context)
{
    var itemtag = context.playStreamEvent.Tags;
    log.info("tags :" + itemtag);

PlayStream:

 "Logs": [
            {
                "Message": "tags :undefined",
                "Level": "Info"
            }

itemtag is always "undefined". What is wrong with my Cloud Script function?

Is it possible to get a catalog item's Tags in Cloud Script

CloudScript
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

I’m afraid that you cannot get a catalog item's “Tags” from the “player_inventory_item_added” event because there is no such property defined : https://docs.microsoft.com/en-us/gaming/playfab/api-references/events/player-inventory-item-added#properties . Instead, you’d need to call Server/GetCatalogItems to get all catalog items and find the specific “Tags” for the item in question:

https://docs.microsoft.com/zh-cn/rest/api/playfab/server/title-wide-data-management/getcatalogitems?view=playfab-rest#catalogitem

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.