Skip to content
← Back to activity

Solution skill

I am trying to find the page id of a page in Figma and map it to the object id in Google Slides

Version 2Sign in to save

Complete solution

So what you want to turn var2 into a variable to capture the ID from var1. to unshift the string from the var1's array. then you want to use the concate with var 2 and var 3 give your slide an id. Here is the code ``` function strings() { var var2 = {}; var var1 = args.document.children; pageJSON.page = []; for (var i in page) { pageJSON.page.push(page[1].id); } function createPresentation(NewSlides, Slide) { var NewSlides = pageJSON.concat(Slide); var presentation = Slides.P Use when hitting th

TL;DR

So what you want to turn var2 into a variable to capture the ID from var1. to unshift the string from the var1's array. then you want to use the concate with var 2 and var 3 give your slide an id.

So what you want to turn var2 into a variable to capture the ID from var1. to unshift the string from the var1's array. then you want to use the concate with var 2 and var 3 give your slide an id. Here is the code `` function strings() { var var2 = {}; var var1 = args.document.children; pageJSON.page = []; for (var i in page) { pageJSON.page.push(page[1].id); } function createPresentation(NewSlides, Slide) { var NewSlides = pageJSON.concat(Slide); var presentation = Slides.Presentations.create({ title: "MyNewPresentation" }); Logger.log("Created presentation with ID: " + presentation.s); function createSlide(presentationId, NewSlides) { // You can specify the ID to use for the slide, as long as it's unique. var pageid = page.stringify(id[0]); var requests = [ { createSlide: { objectId: { insertionIndex: { slideLayoutReference: { predefinedLayout: "TITLE_AND_TWO_COLUMNS" } } } } } ]; var var3 = Slides.Presentations.batchUpdate( { requests: requests }, presentationId(NewSlides) ); Logger.log( "Created Slide with ID: " + slide.replies[0].createSlide.objectId ); } } }

Context: Stack Overflow question (score 1, has accepted answer): Problem: I got args.JSON from Figma API and I am trying to pull only the string “id” from the child array. I'm using google app script and Figma API to create a plugin. I want all the pages in Figma with their respective id to appear in google app script's slides. Reference: how I got the Pages Array from Figma API Figma API Figma Pagenode Google App Script Advanced Slides Service Figma page conversion: ``` var children = args = { "document": { "children": [{ "id": "0:1", "name": "Layouts", "type": "CANVAS", }]}} var page = args.document.children; JSON.page = []; for (var i in page) { JSON.pages.unshift([1]); }; var pageId = args.page.id; idJSON.page.id = []; for (var i in id) { idJSON.id, push(pages[i].("

When to use

  • You hit this exact issue.
  • The symptom matches: I am trying to find the page id of a page in Figma and map it to the object id in Google Slides.

When NOT to use

  • A different error or symptom; the cause here is specific to this one.

Compatibility

Per the linked source.

Edge cases

  • If your error message differs even slightly, this is probably a different issue; search the exact text.
  • If the fix does not help, capture the full error output and check the source link for updates.

Evidence

Stack Overflow question (score 1, has accepted answer): Problem: I got args.JSON from Figma API and I am trying to pull only the string “id” from the child array. I'm using google app script and Figma API to create a plugin. I want all the pages in Figma with their respective id to appear in google app script's slides. Reference: how I got the Pages Array from Figma API Figma API Figma Pagenode Google App Script Advanced Slides Service Figma page conversion: `` var children = args = { "document": { "children": [{ "id": "0:1", "name": "Layouts", "type": "CANVAS", }]}} var page = args.document.children; JSON.page = []; for (var i in page) { JSON.pages.unshift([1]); }; var pageId = args.page.id; idJSON.page.id = []; for (var i in id) { idJSON.id, push(pages[i].(" Resolved: So what you want to turn var2 into a variable to capture the ID from var1. to unshift the string from the var1's array. then you want to use the concate with var 2 and var 3 give your slide an id. Here is the code `` function strings() { var var2 = {}; var var1 = args.document.children; pageJSON.page = []; for (var i in page) { pageJSON.page.push(page[1].id); } function createPresentation(NewSlides, Slide) { var NewSlides = pageJSON.concat(Slide); var presentation = Slides.Presentations.create({ title: "MyNewPresentation" }); Logger.log("Created presentation with ID: " + presentation.s); function createSlide(presentationId, NewSlides) { // You can specify the ID to use for the slide, as long as it's unique. var pageid = page.stringify(id[0]); var requests = [ { createSlide: { objectId: { Source: https://stackoverflow.com/questions/58863711/i-am-trying-to-find-the-page-id-of-a-page-in-figma-and-map-it-to-the-object-id-i

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_4WX2kLql5jEWRp07w9qPXA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">I am trying to find the page id of a page in Figma and map it to the object id in Google Slides <span>— Vectle</span></a>

I am trying to find the page id of a page in Figma and map it to the object id in Google Slides | Vectle