• I recently used WP Webhook to set up a Zapier integration to send an email whenever a post type is updated. The post uses ACF custom fields. Everything is wired up right, and I can see the data in Zapier, and output the content of the custom field into the email.

    The problem is that a few of my custom fields are “Post Object” types, and so the content in the email is just an ID referencing another post.

    Is there a way to get some of the content of the referenced post? For example:

    I want to send an email whenever a “Document” post type is updated. The custom fields include a “Language” field which is a reference to another post type, “Langauge”. How can I get the name of the language for the Document, rather than just the ID of the language post it references?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter spaceninja

    (@spaceninja)

    Here’s an example of the Data Out from Zapier, showing the custom fields:

    post_id: 80738
    post__ID: 80738
    post__post_author: 2
    post__post_date: 2020-07-23 17:30:20
    post__post_date_gmt: 2020-07-23 17:30:20
    post__post_title: 100102 – Operator’s Manual – English – All
    post__post_status: publish
    post__comment_status: closed
    post__ping_status: closed
    post__post_name: 100102-operators-manual-english-all
    post__post_modified: 2020-11-30 22:02:45
    post__post_modified_gmt: 2020-11-30 22:02:45
    post__post_parent: 0
    post__guid: https://test.local/?test_document=100102-operators-manual-english-all
    post__menu_order: 0
    post__post_type: test_document
    post__comment_count: 0
    post__filter: raw
    post_meta__inline_featured_image: 0
    post_meta__language: 79571
    post_meta___language: field_5f07a73725344
    post_meta__file: 746
    post_meta___file: field_5f07a77729f2a
    post_meta__type: 79576
    post_meta___type: field_5f07ae655dcfb
    post_meta__version_signifier: 79578
    post_meta___version_signifier: field_5f08e40a15282
    post_meta__version: All Serial Numbers
    post_meta___version: field_5f08e471fd016
    post_meta___edit_lock: 1606773772:2
    post_meta___edit_last: 2
    post_meta__version_is_range: 0
    post_meta___version_is_range: field_5f08e42015283
    post_before__ID: 80738
    post_before__post_author: 2
    post_before__post_date: 2020-07-23 17:30:20
    post_before__post_date_gmt: 2020-07-23 17:30:20
    post_before__post_title: 100102 – Operator’s Manual – English – All
    post_before__post_status: publish
    post_before__comment_status: closed
    post_before__ping_status: closed
    post_before__post_name: 100102-operators-manual-english-all
    post_before__post_modified: 2020-07-23 17:30:20
    post_before__post_modified_gmt: 2020-07-23 17:30:20
    post_before__post_parent: 0
    post_before__guid: https://test.local/?test_document=100102-operators-manual-english-all
    post_before__menu_order: 0
    post_before__post_type: test_document
    post_before__comment_count: 0
    post_before__filter: raw
    post_thumbnail: False
    post_permalink: https://testsite.local/?test_document=100102-operators-manual-english-all

    Thread Starter spaceninja

    (@spaceninja)

    Actually a better example is grabbing the URL of the file field — post_meta__file — All I have is an ID. How do I translate that into a URL to access that file?

    Plugin Contributor Ironikus

    (@ironikus)

    Hey @spaceninja – Thank you for reaching out, as well as for using our plugin. ??

    In case the given meta id is a post id, you can make a secondary request within Zapier to fetch the post data using the get_post webhook action.

    If it is a custom id from a third-party plugin that does not use the default posts, you would have to extend the logic using some custom lines of code.
    We have a filter available for that: https://ironikus.com/docs/knowledge-base/filter-webhook-trigger-data/

    If you have any further questions, please let me know.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Webhook access to custom fields that are post objects?’ is closed to new replies.