web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Suggested answer

Adding Rows to a table - null values & trigger error

(0) ShareShare
ReportReport
Posted on by 12

I have a flow set up to add rows to a table in a pbix report.  I received an error for null values when adding rows.  I attempted adding the following expression to account for nulls:

 

if(empty(triggerOutputs()?['ColumnName']),'',triggerOutputs()?['ColumnName'])
 
but I now get this error when triggering the flow:
 

The input body for trigger 'manual' of type 'Request' did not match its schema definition. Error details: 'Required properties are missing from object: entity.'.

 

Any insight as to the error and if my expression is incorrect?

I have the same question (0)
  • Suggested answer
    Ellis Karim Profile Picture
    11,473 Super User 2025 Season 2 on at
    Adding Rows to a table - null values & trigger error
    The use of the question mark in the expression triggerOutputs()?['ColumnName'] means that if 'ColumnName' does not exist, it will return a null value. Null value is not the same as empty.
     
    So I think you need a condition to check for null values:
    if(
        equals(triggerOutputs()?['ColumnName'], null),
        '',
        triggerOutputs()?['ColumnName']
    )
    
     
    Make sure to check that triggerOutputs()?['ColumnName'] is the correct way to reference the column.  Are you sure it is not something like triggerOutputs()?['body/ColumnName'] ?
     
     
     
    Ellis
  • SH-21101628-0 Profile Picture
    12 on at
    Adding Rows to a table - null values & trigger error
    I tried the suggested change - still fails with the same error code.  I tried inserting 'body/... into the expression and it would not allow me to update the expression.
     
    Allow me to better explain the situation.  The columns I'm exporting inevitably will have null values at the row level.  They are text columns, so I don't want to have a zero replacing the null or empty cell.  I made the assumption that the flow failed because of this.  
  • SH-21101628-0 Profile Picture
    12 on at
    Adding Rows to a table - null values & trigger error
    here is the original error for failure:
     
    The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@triggerBody()?['entity']?['Power BI values']' is of type 'Null'. The result must be a valid array.
  • Ellis Karim Profile Picture
    11,473 Super User 2025 Season 2 on at
    Adding Rows to a table - null values & trigger error
    Re-run the flow using the following modified expression:
     
    @triggerBody()['entity']['Power BI values']
     
    Please share the error message.
     
    Which trigger are you using and can you share some sample data?
     
    Ellis
  • SH-21101628-0 Profile Picture
    12 on at
    Adding Rows to a table - null values & trigger error
    Ellis, thank you for your help with this.  I have cleared all of my error variable except one.  
     
    I have a column in PBI that Flow is classifying as type: number.  The column contains percentages and '-' when no percentage is calculated.  
     
    So, am I correct in assuming it is failing because Automate cannot read the '-' as a number?  
     
    Is there a way to change the type in the execution of the flow? 
  • SH-21101628-0 Profile Picture
    12 on at
    Adding Rows to a table - null values & trigger error
    I am finding now that the expression results not adding the row. There are instances where a row may or may not have a value in the collection of columns i'm trying to add to the file.
     
    For instance, I have 5 columns of data and a row may only have data for 3 of the 5 columns.  I still need that row to populate.
     
    So, it seems the conditional statement I started with is incorrect.
     
    Help?
  • Suggested answer
    Ellis Karim Profile Picture
    11,473 Super User 2025 Season 2 on at
    Adding Rows to a table - null values & trigger error
    For instance, I have 5 columns of data and a row may only have data for 3 of the 5 columns.  I still need that row to populate.
     
    If you have the following JSON dataset, but it's missing Column3 and Column4:
    {
      "triggerBody": {
        "entity": {
          "Column1": "SampleData1",
          "Column2": "SampleData2",
          "Column5": "SampleData5"
        }
      }
    }
    We can use the following expressions to return the value for each of the columns. The expression uses the coalesce function which is a bit easier to use than the IF function condition in this instance. If any column is missing from the data we return "😢empty!"
    coalesce(variables('varTriggerBody')?['triggerBody']?['entity']?['Column1'], '😢empty!')
    coalesce(variables('varTriggerBody')?['triggerBody']?['entity']?['Column2'], '😢empty!')
    coalesce(variables('varTriggerBody')?['triggerBody']?['entity']?['Column3'], '😢empty!')
    coalesce(variables('varTriggerBody')?['triggerBody']?['entity']?['Column4'], '😢empty!')
    coalesce(variables('varTriggerBody')?['triggerBody']?['entity']?['Column5'], '😢empty!')
     
    The outputs from the above expressions:
    variables('varTriggerBody')?['triggerBody']?['entity']?['Column1'] = SampleData1
    variables('varTriggerBody')?['triggerBody']?['entity']?['Column2'] = SampleData1
    variables('varTriggerBody')?['triggerBody']?['entity']?['Column3'] = 😢empty!
    variables('varTriggerBody')?['triggerBody']?['entity']?['Column4'] = 😢empty!
    variables('varTriggerBody')?['triggerBody']?['entity']?['Column5'] = SampleData1
     
     
     
     
    Hopefully this will give you some idea on how to handle the missing columns from the data using the "question mark notation".
     
    I'll need to see the sample data as I'm finding hard to visualise the your data.
     
    Ellis
  • SH-21101628-0 Profile Picture
    12 on at
    Adding Rows to a table - null values & trigger error
    Again, Ellis, thank you for your help.  Here is hopefully a better detailed explanation.  Here are 5 columns in the report:
     
    Servicing Plant - Biloxi or (blank) if no return
    Manager - Bob Smith or (blank) if no return
    Customer - 12345
    Sales - $$ or (blank) if no return
    Still doing business? - "Y" for Yes, (blank) for No
     
    Due to various reasons (ie. bad data, no sales, poor maintenance) some fields may result in (blank) or null.  But the row still needs to populate when the flow is triggered.  In other words, if there are 50 customers known in the Servicing Plant, then 50 rows should populate, even if there is no longer a Manager attached to the customer, or if there are no sales for the date range, or if due to poor maintenance, the Servicing Plant was removed in the system.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 659 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 386 Moderator

#3
chiaraalina Profile Picture

chiaraalina 290

Last 30 days Overall leaderboard