Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

How to add multiple rows to Smartsheet

kanemku
メテオール

Hello, 

 

I'm having issues trying to figure out how to add multiple rows to Smartsheet. I'm using workflows from @ivoller from this post about connecting to and pushing data into Smartsheet.  Using the "Write new Smartsheet Record" workflow, I'm successfully able to push one record into Smartsheet, but when I try to alter the inputs to have more than one row to add, it concatenates all of them into one row.

 

kanemku_1-1660574413208.png

 

 

I then get error 1037 back from Smartsheet saying that I have the same column ID in the row more than once.

 

kanemku_0-1660574381645.png

 

 

This won't work for me because I'm trying to push records from one database into Smartsheet using Alteryx, and there will be thousands of records passed through. 

 

How can I form the JSON to match Smartsheet's requirements so that I can add multiple rows programmatically? 

 

THANK YOU!

3件の返信3
BonusCup
ファイアボール

@kanemku 
I was just able to figure this out. The first thing you will need to do is figure out your Smartsheet Column IDs, also take note of the other highlighted fields.  I used Postman to figure these out.

smartsheetPostman.JPG

 

  • I created a Text Input with the column information. 

smartsheetColumnIDs.JPG

 

  • I created some sample data with the field names matching the field names in my Smartsheet
  • Added a RecordID and transposed the data with the RecordID as the Key Column.

smartsheetTranspose.JPG

  • Rename the 'Name' column coming out of the Transpose to "Column" with a Select tool
    Capture.JPG

  • I have a Dropdown list as a field so I added a 'Type' field with a Formula tool
    • if [Column] = 'Status' then 'PICKLIST' ELSE Null() endif
      smartsheetFormula.JPG
  • Join the column IDs back in
    smartsheetJoin.JPG

 

From there, I used the rest of the workflow you referenced from @ivoller's post but in the Summarize tool I grouped by RecordID to create individual records.

 

smartsheetMultipleRows.JPG

Hope this helps.

BonusCup
ファイアボール

[UPDATE]

 

Looks like I've run into an issue with writing a large count of rows to Smartsheet. 

I am able to create a single row but multiple row testing it shows that it's getting every other row or even more occasionally.  Anyone run into this issue?

Capture.JPG

BonusCup
ファイアボール

SUCCESS!!!

Found the solution using this Smartsheet Community post:  https://community.smartsheet.com/discussion/100330/bulk-post-operation-syntax

 
  • After getting your data in order, sort by RecordID and then ColumnID
    smartsheetSort.JPG
  • Create a field named "cell"
    • Use formula:
      '{
      "columnId": '+id+',
      "value": "' +[Value]+ '"
      }

  • Summarize Tool
    • Group By:  RecordID
    • Concatenate:  cell
      • I renamed this to "cells

  • Sort again by RecordID

  • Use a Formula tool for 'cells'
    • Formula
      '[
      {
      "toTop": true,
      "cells": [
      '+[cells]+ '
      ]
      }
      ]'

  • Summarize Tool
    • Concatenate:  cells
      • I renamed this to "JSON_Output"

  • Formula Tool
  • Download Tool
    • Basic tab
      • URL Field = URL
    • Headers tab
      • Authorization = Bearer {token}
      • Content-Type = application/json
    • Payload tab
      • HTTP Action = POST
      • Take Query String/Body from Field = JSON_Output

 

Check your Smartsheet for new rows.

 

Good luck, hope this helps. 

 

ラベル