When a new row is created in smartsheet get the data from that new row and use it in Power Automate

Options
2»

Answers

  • RSteele
    RSteele ✭✭
    edited 08/15/23
    Options

    @Jaime M. I have a solution. It isnt Pretty but it works. one output option from the new row created is to get an HTML Table of the data. I take this and convert it to an array, then into dynamic objects.

    When a New Row is Created: Generates HTML Table with form submission Data


    ReplaceTR:

    replace(triggerOutputs()?['body/rowHTML'],'</tr>','|</tr>')


    ReplaceTD:

    replace(outputs('ReplaceTR'),'</td>','^</td>')


    HTML to Text:

    Outputs to Plain Text


    NewLine:


    Creates a new Line. literally just hit Enter in the compose


    ReplaceNewLine:

    replace(outputs('Html_to_text')?['body'],outputs('NewLine'),'')


    Rows:

    skip(split(outputs('ReplaceNewLine'),'|'),1)


    Filter Array:

    @greater(length(trim(item())), 0)


    Select:

    Map Each Individual Column IN ORDER on the left, and do a split function on the right starting with the number 0 and going up:

    {

    "Column Name": @{split(item(),'^')[0]},

    "Column name2": @{split(item(),'^')[1]},

    }

    at this point, run the flow and take the output of the select step and put it in the schema example box of the parseJSON step. This will create the dynamic objects you can then use for whatever.

    ParseJSON:

    {

    "type": "array",

    "items": {

    "type": "object",

    "properties": {

    "Row ID": {

    "type": "string"

    },

    "Modified": {

    "type": "string"

    },

    "Created": {

    "type": "string"

    }