I am currently facing a challenge with the implementation of a script involving a REST connector. Specifically, the query works as expected when entered within the request body box of the REST connector, but encounters difficulties when incorporated into a script.
The variable v_cursor serves as a key that dynamically changes with each execution and comes from the previous query.
I would greatly appreciate any guidance or assistance you could provide in resolving this matter.
Below is the relevant script snippet:
LET v_cursor = Peek('cursor', 0, 'items_page');
// STEP 2 - Next item page LET v_next_page_body = ' "{""query"":""{next_items_page(cursor: $(v_cursor) ) { cursor items { id name column_values { column { title } text } }}""}" ';
// The query that works inside the box:
// { "query": "{ next_items_page(cursor: \"MSwxNjM2MjU3NzkzLG9tV2VnQVpfWnJCVnFLNEZQMzFaeCw5MTgsMjUsfDEyNjkxMzAzMTg\" ) { cursor items { id name column_values { column { title } text } }}"}
RestConnectorMasterTable: SQL SELECT "account_id", "__KEY_root", (SELECT "__KEY_data", "__FK_data", (SELECT "cursor", "__KEY_next_items_page", "__FK_next_items_page", (SELECT "id", "name", "__KEY_items", "__FK_items", (SELECT "text", "__KEY_column_values", "__FK_column_values", (SELECT "title", "__FK_column" FROM "column" FK "__FK_column") FROM "column_values" PK "__KEY_column_values" FK "__FK_column_values") FROM "items" PK "__KEY_items" FK "__FK_items") FROM "next_items_page" PK "__KEY_next_items_page" FK "__FK_next_items_page") FROM "data" PK "__KEY_data" FK "__FK_data") FROM JSON (wrap on) "root" PK "__KEY_root" WITH CONNECTION( Url "https://api.monday.com/v2", HTTPHEADER "Authorization" $(v_auth), HTTPHEADER "Content-Type" "application/json", HTTPHEADER "API-Version" "2023-10", BODY $(v_next_page_body) );