cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Darsh_Antani
New Member

Count number of columns and ordering of column in PowerApps

Hello All,

 

We have a requirement where we need to compare 2 excel contents and get the below data out of it:

 

1. Get the count of Number of columns in the excel table

2. Get the ordering of columns in the excel table

3. Get the data type of column of table in excel

 

After getting all these, we will compare both excel and if not matched, it will not allow user to upload the document.

 

How can we achieve this using powerapp?

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi@Darsh_Antani,

Could you please tell me that if this ordering of columns in the excel table means that the column rank order?

I can tell you that if you want to get the rank order of the column within the Excel table, I am afraid that there is no way to achieve this currently in PowerApps.

For the third question, to get the information of the data type from the Excel table, it's the same result. There is no way to achieve this currently in PowerApps.

I could only provide a solution for the first problem. You could concatenate each field (column value) of your record into one single string using the Concatenate() function, then you could use Split() function to split the concatenated string into a single column table.

I have an Excel table as below:

76.png

I assume that you want to split the first record of the Excel table into a single column table, please take a try with the following formula:

CountRows(
    Split(
        Concatenate(
            First(Table2).City,
            ", ",
            First(Table2).Country,
            ", ",
            First(Table2).Employee
        ),
        ", "
    )
)// Set the Text property of a Label

Note: The result will return the number of the column quantity.

Hope it could help.

Regards,

Qi

Best Regards,
Qi

View solution in original post

1 REPLY 1
v-qiaqi-msft
Community Support
Community Support

Hi@Darsh_Antani,

Could you please tell me that if this ordering of columns in the excel table means that the column rank order?

I can tell you that if you want to get the rank order of the column within the Excel table, I am afraid that there is no way to achieve this currently in PowerApps.

For the third question, to get the information of the data type from the Excel table, it's the same result. There is no way to achieve this currently in PowerApps.

I could only provide a solution for the first problem. You could concatenate each field (column value) of your record into one single string using the Concatenate() function, then you could use Split() function to split the concatenated string into a single column table.

I have an Excel table as below:

76.png

I assume that you want to split the first record of the Excel table into a single column table, please take a try with the following formula:

CountRows(
    Split(
        Concatenate(
            First(Table2).City,
            ", ",
            First(Table2).Country,
            ", ",
            First(Table2).Employee
        ),
        ", "
    )
)// Set the Text property of a Label

Note: The result will return the number of the column quantity.

Hope it could help.

Regards,

Qi

Best Regards,
Qi

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,592)