3

My compose statement is reading in excel table.

However when it gets to a blank row i get error "Action 'Compose_2' failed"

Is there anyway to bypass this error to deal with blank records? These compose 1 and 2s are done for 5 different date columns, hence 10 composes.

If any of these are empty cells, I want to have my compose not fail , I want it to output empty and I want it to continue to the next column.

compose 1 -

items('Apply_to_each')?[concat('Period Planned ', '/', ' Revised Date')]

Compose 2 -

addDays('1899-12-30',int(outputs('Compose')),'yyyy-MM-dd')

blank row throwing error:

enter image description here

full flow - enter image description here

enter image description here

enter image description here

data coming in (online excel)-

enter image description here

output list -

enter image description here

So it looks like my 2nd record in the incoming data isnt going into my sp list - which is fine - just its throwing an error in my power automate flow... Ideally would be nice to copy it over regardless and not pass over it.

Jonnyboi
  • 505
  • 5
  • 19

1 Answers1

2

Just looking at your approach and using Compose steps where you have, there's nothing wrong with that but I'm ultimately missing context around the rest of the flow.

Because of that, I've ignored your loop component (because I can see you're doing that based on the expressions) and focussing on what you can do prior to your loop so you don't have to deal with blank records.

This is the basic table I am working with ...

Table

You can clearly see that there is a single blank record that I have used to test with.

This is the basic flow I mocked up the answer with ...

Flow

You can see, I've taken the data from the Excel table and simply filtered on it so as to remove any records that are deemed as being blank.

The expression to the right hand side of the filter is simply ...

string('')

... and you can see I've chosen records that are not equal to.

Now, if you look at the data before and after ...

Before Filter ...

[
    {
        "@odata.etag": "",
        "ItemInternalId": "5353aa33-9512-458d-8bf7-99d59aa981a3",
        "Revised Date": "2023-02-20T00:00:00.000Z"
    },
    {
        "@odata.etag": "",
        "ItemInternalId": "1538d945-7516-4618-b080-a391ea65d7a9",
        "Revised Date": "2023-02-20T00:00:00.000Z"
    },
    {
        "@odata.etag": "",
        "ItemInternalId": "d44e2dbd-5606-44aa-b4d6-c7835f0a781c",
        "Revised Date": ""
    },
    {
        "@odata.etag": "",
        "ItemInternalId": "91d471f6-3729-4d49-887a-0fb43c2cd37c",
        "Revised Date": "2023-02-20T00:00:00.000Z"
    },
    {
        "@odata.etag": "",
        "ItemInternalId": "8117d5b9-e805-4d2f-a2eb-43085db70258",
        "Revised Date": "2023-02-20T00:00:00.000Z"
    },
    {
        "@odata.etag": "",
        "ItemInternalId": "b37bbb39-47e2-403d-bedf-8440dc1ff699",
        "Revised Date": "2023-03-06T00:00:00.000Z"
    },
    {
        "@odata.etag": "",
        "ItemInternalId": "2944a98d-71a4-4a63-8bd9-356386c9a03b",
        "Revised Date": "2023-03-13T00:00:00.000Z"
    }
]

After Filter ...

{
    "body": [
        {
            "@odata.etag": "",
            "ItemInternalId": "5353aa33-9512-458d-8bf7-99d59aa981a3",
            "Revised Date": "2023-02-20T00:00:00.000Z"
        },
        {
            "@odata.etag": "",
            "ItemInternalId": "1538d945-7516-4618-b080-a391ea65d7a9",
            "Revised Date": "2023-02-20T00:00:00.000Z"
        },
        {
            "@odata.etag": "",
            "ItemInternalId": "91d471f6-3729-4d49-887a-0fb43c2cd37c",
            "Revised Date": "2023-02-20T00:00:00.000Z"
        },
        {
            "@odata.etag": "",
            "ItemInternalId": "8117d5b9-e805-4d2f-a2eb-43085db70258",
            "Revised Date": "2023-02-20T00:00:00.000Z"
        },
        {
            "@odata.etag": "",
            "ItemInternalId": "b37bbb39-47e2-403d-bedf-8440dc1ff699",
            "Revised Date": "2023-03-06T00:00:00.000Z"
        },
        {
            "@odata.etag": "",
            "ItemInternalId": "2944a98d-71a4-4a63-8bd9-356386c9a03b",
            "Revised Date": "2023-03-13T00:00:00.000Z"
        }
    ]
}

... the blank record has been removed.

From here, your loop should refer to the output of the Filter array step and not the output from the List rows present in a table step as that has now been superseded by the cleaner set of data.

Skin
  • 9,085
  • 2
  • 13
  • 29
  • But each row may have 5 columns but only column 1 is an empty cell(in excel) , will this work with the other 4 columns and not skip those? – Jonnyboi May 05 '23 at 13:25
  • I think you need to update your question and be a lot clearer with your requirement. If there are additional columns that you’re checking for, you need to be explicit with your question. Provide examples for data coming in and data going out. – Skin May 05 '23 at 13:27
  • ok updated question - hopefully it makes sense – Jonnyboi May 05 '23 at 17:25
  • Well, not entirely. If you’re doing the same thing over each column then just have a filter step before processing each column that removes the blanks. It’s not clear how you’re processing the data but from what you’ve said, it sounds like you’re processing each cell, not each row. So just replicate the filter step each time and change the column you’re filtering on to be the next date column from the last. Make sense? – Skin May 05 '23 at 21:00
  • I th ink so.. but I still want to include the row values that have empty cells in excel in my sharepoint list. Not skip those rows. – Jonnyboi May 08 '23 at 13:20