When a new row is created in smartsheet get the data from that new row and use it in Power Automate
I have a Smartsheet sheet which is populated using a Smartsheet form. When the form is submitted it creates a new row in the Smartsheet and inserts the relevant form data into the corresponding Smartsheet columns.
I now want to use the data from that row in a flow in Power Automate. I am using the "When a new row is created" trigger but I am struggling to then access/use the data in the columns of that new row.
For example one of the values is User Department Name - I want to take the value from that column for the newly inserted row and use it in Power Automate email or updating a sharepoint list etc... etc...
Any ideas?!
Best Answer
-
It sounds like this has something to do with the functionality of the Power Automate workflow. I checked the Microsoft Community and found this older post, here: Smartsheet - When new row is added. One of the solutions suggested on this post is to use the expression builder instead.
There's another post here: Add a row from Smartsheet to excel.
If neither of these have resolved your specific issue, I would recommend posting in the Microsoft Power Automate Community for more help, with screen captures if possible.
Cheers!
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
Answers
-
It sounds like this has something to do with the functionality of the Power Automate workflow. I checked the Microsoft Community and found this older post, here: Smartsheet - When new row is added. One of the solutions suggested on this post is to use the expression builder instead.
There's another post here: Add a row from Smartsheet to excel.
If neither of these have resolved your specific issue, I would recommend posting in the Microsoft Power Automate Community for more help, with screen captures if possible.
Cheers!
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
I struggled a lot with this until I realized there is an easy formula for just extracting the data from the last row. After your trigger, you do have to use the 'Get a sheet data (dynamic schema)' action which gives you the data from the entire sheet.
After that, do a compose action and write the following formula:
last(outputs('Get_a_sheet_data_(dynamic_schema)')?['body/value']
This gives you only the relevant information in the form of an object. I like to name this "Last Row Only"
I then like to generate an array from this object by using another compose action with a simple formula:
createArray(outputs('Last_Row_Only'))
which you can then use if you want to generate an HTML table
-
@Laurel Stokely this is what I am looking for, but when I insert the compose operation and paste in the last(outputs('Get_a_sheet_data_(dynamic_schema)')?['body/value'] I get a notification the expression is invalid.
What am I doing wrong?
-
This content has been removed.
-
first expression is missing an end parens, should be:
last(outputs('Get_a_sheet_data_(dynamic_schema)'))?['body/value']
and watch out for smart apostrophes
-
First "Compose" = last(outputs('Get_a_sheet_data_(dynamic_schema)')?['body/value'])
second "Compose 2" = createArray(outputs('Compose'))
-
This solution worked but I had to make a few tweaks..
- the last() function expects an array, so i needed to change the object returned from 'Get_a_sheet_data_(dynamic_schema)' into an array 1st.
- then i ran last() on that result.
- Then i use "Parse JSON" to parse that row into objects
end result looks something like this
*Get Last Row of Sheet data function = last(outputs('Compose-convertSheetDataToArray'))*
I can then use the results from the parse as objects.
I still don't like the fact that we need to load the whole smartsheet to do this, but it seems to work. Hopefully, smartsheet can work on exposing these columns/values as objects when a new row is created.
-
Need some help on this one. I am trying to accomplish something similar where I am trying to simply send out an email that contains the data entered from a Smartsheet form.
So someone submits a form in Smartsheet and powerautomate takes the data from the form and sends it in an email.
When I use the smartsheet dynamic content in the "send email" action via powerautomate, powerautomate automatically places that send email action. That creates a loop so powerautomate will send multiple emails.
To avoid that I tried doing what you guys did in the thread, but I can't find a way to get the dynamic content from the smartsheet form (row data) into the emails.
Here's what I have so far:
-
hi @mbsamuel6 ,
Its been a while since i worked on this but maybe this will help. I couldn't tell if you created a schema for your "Compose - Get Last Row of Sheet Data" output, but I needed to do that in order to see the properties in any steps following the Parse one. Basically all of your columns in the row need to be explicitly typed in your schema for PA to use.
FYI - if you have a column that can be of type string, integer or null make sure you put all three as the options for type or you'll get an error when the flow runs into that value.
-
@KelvinC thank you so much for the response.
What you're saying makes sense and it solved my issue.
One thing I noticed I did wrong was my code in JSON was wrong as you mentioned.
So I simply looked at my outputs created by the Compose action "Get Last Row of Sheet Data" and copied that into the JSON and then created a Sample code. Now all my values from the JSON are appearing in the email.
Just in case anyone needs to see the code for the compose actions:
1) Convert Sheet Data into Array- "value" (Smartsheet dynamic content named value)
2) Get Last Row of Sheet Data - last(outputs('Get_a_sheet_data_(dynamic_schema)')?['body/value'])
-
So recentely came across this forum and followed the step to create a flow in power automate. However, in my testing I found that the Compose-Convertsheetdatatoanarray is irrelevant. I get the same results in the end but I am skipping the portion that grab all the smartsheet data and just grabs the last record (see the picture). Am I wrong in thinking this?
-
Does anyone have a solution for getting data from the new row added, which may not always be the last row, if multiple rows are added at a time? Each row has a unique identifier.
-
I had the same issue. I found one work around. When a new form is submitted, the data from that form is entered in the top (first) row by default.
You can change this to make it appear in the bottom row in the form settings. That should help.
So now that compose2 action that looks at the last row will focus on the data from new forms submitted.
Let me know if that makes sense
-
Hey!
Yes, that makes sense. The only problem is when multiple requests hit the sheet at the same time, and power automate only looks at the last row instead of the 5 new rows, it sends 5 emails based on the same row of data.
I need a way to identify the specific new row it should be referencing (by unique row ID?) rather than the "last" row, since we will have a lot of requests being processed simultaneously.
-
I am having the same problem. I get multiple form entries at the same time. Ive thought of trying to delay the row being added to the sheet, but that isnt possible. hopwfully we find a solution soon!
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 140 Industry Talk
- 472 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives