<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: connector SDk : &amp;quot;Why is the 'Create Account' action not working in my Salesforce custom con in Workato Pros Discussion Board</title>
    <link>https://systematic.workato.com/t5/workato-pros-discussion-board/connector-sdk-quot-why-is-the-create-account-action-not-working/m-p/8332#M3480</link>
    <description>&lt;P&gt;Hi Patel,&lt;BR /&gt;Did you try using test.salesforce.com instead of login.salesforce.com.&lt;BR /&gt;Just a thought, since you are using a playground org.&lt;BR /&gt;Regards,&lt;BR /&gt;Siddhartha&lt;/P&gt;</description>
    <pubDate>Tue, 17 Dec 2024 12:46:24 GMT</pubDate>
    <dc:creator>Prudvi</dc:creator>
    <dc:date>2024-12-17T12:46:24Z</dc:date>
    <item>
      <title>connector SDk : "Why is the 'Create Account' action not working in my Salesforce custom connector?"</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/connector-sdk-quot-why-is-the-create-account-action-not-working/m-p/8238#M3453</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I'm building a custom connector for Salesforce and have implemented a 'Create Account' action. However, it’s not working as expected. Here's my setup:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Connection Details&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;OAuth2 authorization is configured with client ID, client secret, and token endpoints.&lt;/LI&gt;&lt;LI&gt;The base URI points to the Salesforce instance URL&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Action Code for 'Create Account'&lt;/STRONG&gt;:&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;create_account:&lt;/SPAN&gt; { &lt;SPAN class=""&gt;description:&lt;/SPAN&gt; &lt;SPAN class=""&gt;'Create Salesforce Account'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;input_fields:&lt;/SPAN&gt; -&amp;gt;(_object_definitions) { [ { &lt;SPAN class=""&gt;name:&lt;/SPAN&gt; &lt;SPAN class=""&gt;'Name'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;type:&lt;/SPAN&gt; &lt;SPAN class=""&gt;'string'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;optional:&lt;/SPAN&gt; &lt;SPAN class=""&gt;false&lt;/SPAN&gt; }, { &lt;SPAN class=""&gt;name:&lt;/SPAN&gt; &lt;SPAN class=""&gt;'Phone'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;type:&lt;/SPAN&gt; &lt;SPAN class=""&gt;'string'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;optional:&lt;/SPAN&gt; &lt;SPAN class=""&gt;true&lt;/SPAN&gt; } ] }, &lt;SPAN class=""&gt;execute:&lt;/SPAN&gt; &lt;SPAN class=""&gt;lambda&lt;/SPAN&gt; &lt;SPAN class=""&gt;do&lt;/SPAN&gt; |&lt;SPAN class=""&gt;connection, input&lt;/SPAN&gt;| post(&lt;SPAN class=""&gt;"&lt;SPAN class=""&gt;#{connection['base_uri']}&lt;/SPAN&gt;/services/data/v62.0/sobjects/Account/"&lt;/SPAN&gt;)&lt;/DIV&gt;&lt;DIV class=""&gt;.payload( &lt;SPAN class=""&gt;Name&lt;/SPAN&gt;: input[&lt;SPAN class=""&gt;'account_name'&lt;/SPAN&gt;], &lt;SPAN class=""&gt;Phone&lt;/SPAN&gt;: input[&lt;SPAN class=""&gt;'phone'&lt;/SPAN&gt;] ) &lt;SPAN class=""&gt;end&lt;/SPAN&gt;, &lt;SPAN class=""&gt;output_fields:&lt;/SPAN&gt; -&amp;gt;(_object_definitions) { [ { &lt;SPAN class=""&gt;name:&lt;/SPAN&gt; &lt;SPAN class=""&gt;'Id'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;type:&lt;/SPAN&gt; &lt;SPAN class=""&gt;'string'&lt;/SPAN&gt; }, { &lt;SPAN class=""&gt;name:&lt;/SPAN&gt; &lt;SPAN class=""&gt;'Name'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;type:&lt;/SPAN&gt; &lt;SPAN class=""&gt;'string'&lt;/SPAN&gt; } ] } }&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE&gt;&lt;STRONG&gt;Observed Issue&lt;/STRONG&gt;:&lt;BR /&gt;The action fails when executed. It either returns an '302 not found'error.&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Questions:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Is there an issue with the post request or payload structure?&lt;/LI&gt;&lt;LI&gt;Do I need to explicitly specify headers for the API call, such as "Content-Type": "application/json"?&lt;/LI&gt;&lt;LI&gt;Could it be a problem with the base_uri or endpoint used?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Any insights or suggestions are greatly appreciated! Thanks in advance.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;SDK Console Code:-&amp;nbsp;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;title: 'Salesforce Connector',&lt;BR /&gt;connection: {&lt;BR /&gt;fields: [&lt;BR /&gt;{ name: 'client_id', optional: false },&lt;BR /&gt;{ name: 'client_secret', optional: false, control_type: 'password' }&lt;BR /&gt;],&lt;BR /&gt;authorization: {&lt;BR /&gt;type: 'oauth2',&lt;BR /&gt;authorization_url: lambda do |connection|&lt;BR /&gt;client_id = connection['client_id']&lt;BR /&gt;redirect_uri = "&lt;A href="https://www.workato.com/oauth/callback" target="_blank" rel="noopener"&gt;https://www.workato.com/oauth/callback&lt;/A&gt;"&lt;BR /&gt;scope = "full"&lt;BR /&gt;"&lt;A href="https://login.salesforce.com/services/oauth2/authorize?response_type=code&amp;amp;client_id=#{client_id}&amp;amp;redirect_uri=#{redirect_uri}&amp;amp;scope=#{scope" target="_blank" rel="noopener"&gt;https://login.salesforce.com/services/oauth2/authorize?response_type=code&amp;amp;client_id=#{client_id}&amp;amp;redirect_uri=#{redirect_uri}&amp;amp;scope=#{scope&lt;/A&gt;}"&lt;BR /&gt;end,&lt;BR /&gt;token_url: lambda do |_connection|&lt;BR /&gt;"&lt;A href="https://login.salesforce.com/services/oauth2/token" target="_blank" rel="noopener"&gt;https://login.salesforce.com/services/oauth2/token&lt;/A&gt;"&lt;BR /&gt;end,&lt;BR /&gt;client_id: lambda do |connection|&lt;BR /&gt;connection['client_id']&lt;BR /&gt;end,&lt;BR /&gt;client_secret: lambda do |connection|&lt;BR /&gt;connection['client_secret']&lt;BR /&gt;end,&lt;BR /&gt;apply: lambda do |connection, access_token|&lt;BR /&gt;headers("Authorization": "Bearer #{access_token}")&lt;BR /&gt;end,&lt;BR /&gt;refresh_on: [401, 403],&lt;BR /&gt;refresh: lambda do |connection, refresh_token|&lt;BR /&gt;response = post("&lt;A href="https://login.salesforce.com/services/oauth2/token" target="_blank" rel="noopener"&gt;https://login.salesforce.com/services/oauth2/token&lt;/A&gt;")&lt;BR /&gt;.payload(&lt;BR /&gt;grant_type: "refresh_token",&lt;BR /&gt;client_id: connection['client_id'],&lt;BR /&gt;client_secret: connection['client_secret'],&lt;BR /&gt;refresh_token: refresh_token&lt;BR /&gt;)&lt;BR /&gt;{&lt;BR /&gt;access_token: response['access_token'],&lt;BR /&gt;refresh_token: response['refresh_token']&lt;BR /&gt;}&lt;BR /&gt;end&lt;BR /&gt;},&lt;BR /&gt;base_uri: lambda do |connection|&lt;BR /&gt;'&lt;A href="https://curious-otter-480hm5-dev-ed.trailblaze.lightning.force.com/" target="_blank" rel="noopener"&gt;https://curious-otter-480hm5-dev-ed.trailblaze.lightning.force.com/&lt;/A&gt;'&lt;BR /&gt;end&lt;BR /&gt;},&lt;BR /&gt;test: lambda do |_connection|&lt;BR /&gt;get("/services/data/v57.0/sobjects/Account/")&lt;BR /&gt;end,&lt;BR /&gt;actions: {&lt;BR /&gt;fetch_account: {&lt;BR /&gt;description: 'Fetch Salesforce Account',&lt;BR /&gt;input_fields: -&amp;gt;(_object_definitions) {&lt;BR /&gt;[&lt;BR /&gt;{ name: 'account_id', type: 'string', optional: false }&lt;BR /&gt;]&lt;BR /&gt;},&lt;BR /&gt;execute: lambda do |connection, input|&lt;BR /&gt;get("#{connection['base_uri']}/services/data/v62.0/sobjects/Account/#{input['account_id']}")&lt;BR /&gt;end,&lt;BR /&gt;output_fields: -&amp;gt;(_object_definitions) {&lt;BR /&gt;[&lt;BR /&gt;{ name: 'Id', type: 'string' },&lt;BR /&gt;{ name: 'Name', type: 'string' },&lt;BR /&gt;{ name: 'Phone', type: 'string' }&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;create_account: {&lt;BR /&gt;description: 'Create Salesforce Account',&lt;BR /&gt;input_fields: -&amp;gt;(_object_definitions) {&lt;BR /&gt;[&lt;BR /&gt;{ name: 'Name', type: 'string', optional: false },&lt;BR /&gt;{ name: 'Phone', type: 'string', optional: true }&lt;BR /&gt;]&lt;BR /&gt;},&lt;BR /&gt;execute: lambda do |connection, input|&lt;BR /&gt;post("#{connection['base_uri']}/services/data/v62.0/sobjects/Account/")&lt;BR /&gt;.payload(&lt;BR /&gt;Name: input['account_name'],&lt;BR /&gt;Phone: input['phone']&lt;BR /&gt;)&lt;BR /&gt;end,&lt;BR /&gt;output_fields: -&amp;gt;(_object_definitions) {&lt;BR /&gt;[&lt;BR /&gt;{ name: 'Id', type: 'string' },&lt;BR /&gt;{ name: 'Name', type: 'string' }&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 12:00:16 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/connector-sdk-quot-why-is-the-create-account-action-not-working/m-p/8238#M3453</guid>
      <dc:creator>Patel0786</dc:creator>
      <dc:date>2024-11-28T12:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: connector SDk : "Why is the 'Create Account' action not working in my Salesforce custom con</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/connector-sdk-quot-why-is-the-create-account-action-not-working/m-p/8332#M3480</link>
      <description>&lt;P&gt;Hi Patel,&lt;BR /&gt;Did you try using test.salesforce.com instead of login.salesforce.com.&lt;BR /&gt;Just a thought, since you are using a playground org.&lt;BR /&gt;Regards,&lt;BR /&gt;Siddhartha&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 12:46:24 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/connector-sdk-quot-why-is-the-create-account-action-not-working/m-p/8332#M3480</guid>
      <dc:creator>Prudvi</dc:creator>
      <dc:date>2024-12-17T12:46:24Z</dc:date>
    </item>
  </channel>
</rss>

