Answers.Body: <p>No you can't. Craft will throw an exception when you insert an id that does not exist into the form. Is there a certain reason for your question? Maybe we could provide help on that. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-22T22:07:48.463Z
Answers.Text: i am trying to import content from api and insert to section[channel type], i am trying to insert id because it will be easy for me to find whether the content that i received from api already exist in my entires or not. if yes then i will just update the content rather than creating duplicate. It will work some how exactly like FeedMe plugin for craft 2.
Answers.UserDisplayName: sailendra mangranti
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-22T22:12:01.243Z
Answers.Text: The better approach would be to fetch to fetch the section by handle `$section = Craft::$app->getSections()->getSectionByHandle('yourHandle');` if it returns `null` you'll create a new section if not you'll work with that
Answers.UserDisplayName: Robin Schambach
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-22T06:57:06.007Z
Answers.LastActivityDate: 2018-03-22T06:57:06.007Z
Answers.UserDisplayName: Robin Schambach
Body: <p>Is is possible to set the "section id" manually by using</p>
  
  <p><code>Craft::$app-&gt;sections-&gt;saveSection($section);</code>?</p>
  
  <p>Can we specify the id of a section in an <code>$section</code> array ?</p>
  
Tags: <craft3>
Title: specifying section id manually while saving section
ThreadText: # specifying section id manually while saving section
  
  (Asked by: username_0 on 2018-03-22)
  
  Is is possible to set the "section id" manually by using
  
  `Craft::$app->sections->saveSection($section);`?
  
  Can we specify the id of a section in an `$section` array ?
  
  **Tags:** craft3
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-03-22. Score: 1 | Accepted answer
  
  No you can't. Craft will throw an exception when you insert an id that does not exist into the form. Is there a certain reason for your question? Maybe we could provide help on that.
  
  > **Comments:**
  > **username_0**: i am trying to import content from api and insert to section[channel type], i am trying to insert id because it will be easy for me to find whether the content that i received from api already exist in my entires or not. if yes then i will just update the content rather than creating duplicate. It will work some how exactly like FeedMe plugin for craft 2.  
  > **username_1**: The better approach would be to fetch to fetch the section by handle `$section = Craft::$app->getSections()->getSectionByHandle('yourHandle');` if it returns `null` you'll create a new section if not you'll work with that  
  
  ---
  
  