Troubleshooting / Errors,

:bullseye: What is your goal?

I want a Make scenario to read a Publish Date from Google Sheets and create a WordPress post with the correct status:

blank or TBD → Draft
future M/D/YYYY date → Scheduled/Future
today or past date → Published

The scenario should then write the WordPress permalink and resulting status back to the same Google Sheets row.

:thinking: What is the problem & what have you tried?

The draft path works, but future scheduling does not.

Current flow:
Google Sheets Search Rows → Google Docs Download a Document → Text Parser → WordPress Create a Post → Google Sheets write-back

Column A is Publish Date.

I have tried:

inline if() / parseDate() expressions in the WordPress Date and Status fields
using the live mapped 2. Publish Date (A) token
moving the logic into a filter before the WordPress module

The WordPress Date field reports Invalid AST / Invalid IML.

In another attempt, selecting the genuine 2. Publish Date (A) mapping token in a filter left the filter operand blank instead of inserting the field.

A production-shaped test row mapped the Google Doc ID correctly, so the row structure itself does not appear to be the issue.

I am trying to determine the correct Make-native architecture. Should this use a Router with separate Draft / Future / Publish routes, and what exact date format does the WordPress Date field require?

:clipboard: Error messages or input/output bundles

Invalid reference in parameter

Invalid IML

Invalid AST

Earlier expression examples included:

{{if(lower(ifempty(…; “tbd”)) = “tbd”; emptystring; parseDate(…; “M/D/YYYY”))}}

and

{{if(lower(ifempty(…; “tbd”)) = “tbd”; “draft”; if(parseDate(…; “M/D/YYYY”) > now; “future”; “publish”))}}

Make also failed to insert the live 2. Publish Date (A) token into a filter operand even though the field appeared selectable.

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

Hey there,

Sorry, can you show screenshots of those formulas? Cause they don’t look like Make formulas in the error you showed.

WordPress needs a real datetime value, so use ISO style:
YYYY-MM-DDTHH:mm:ss

Aslso use a Router with 3 routes after Google Sheets:

  1. Draft
    Filter: empty Publish Date
    or lower(trim(Publish Date)) = tbd

WordPress: Status = draft
Date = leave empty

  1. Future
    Filter: parseDate(Publish Date; M/D/YYYY) > now

WordPress: Status = future
Date = parseDate(Publish Date; M/D/YYYY)

  1. Publish
    Filter: parseDate(Publish Date; M/D/YYYY) <= now

WordPress: Status = publish
Date = parseDate(Publish Date; M/D/YYYY)

+ make sure you are using straight quotes in Make formulas > Smart quotes copied from text editors often cause Invalid IML / Invalid AST.

For the blank mapping token issue, run the Google Sheets module once, confirm the output bundle contains Column A, then remap the field from the actual output. If it still inserts blank, refresh/recreate the Google Sheets module. That is usually a mapping metadata issue.

My guess is you are hitting trouble with the {{ }}, causing Make to throw the “Invalid IML/AST” in the Make formula bar. The whole field is already one expression wrapped in a single outer {{}}. When pasting a mapped token in as {{2.`0`}} inside of yet another {{if(…)}}, you are nesting two expressions and the parser rejects it. Here is another idea of what you can do inside of a formula,

{{if(lower(ifempty(2.`0`; "tbd")) = "tbd"; ""; parseDate(2.`0`; "M/D/YYYY"))}}

This is the same fix for your status expression. Do it separately, don’t feed WordPress’s Date field a raw “M/D/YYYY” string. Now the WP REST API wants ISO 8601, so you should wrap your parsed date with formatDate(…; “YYYY-MM-DDTHH:mm:ss”) and make sure your status is set to “future” (not “publish”) for anything that is dated ahead or the WP will just publish it immediately regardless of the date. You do not need a router for this as a single if() expression can handle all three states. However a router can make the error handling for each branch easier to debug if the scenario grows.