cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Berry_101
Regular Visitor

Nested collection table to SharePoint does not work

Hi,

 

I'm having trouble with getting a nested table column to a SharePoint column. 
The situation is as followed: I have a table 'Test' with column 'Data' and column 'value'. In column value there is a column 'Test1' and 'Test2'. 

Now I want to submit Test 1 to a column in my SharePoint List. This is what I have tried:

ForAll(Test; Patch('SharePoint_List'; Defaults('SharePoint_List'); {SP_Test1: value.Test1; SP_Test2: value.Test2})

The error I get is that the column type doesn't match (both are text). It says it is type Table?

So I tried to add a column to the collection that would transfer the type of the column to text. This does not work either:

AddColumns(Ungroup(Test;"value"); "Test1ToText"; Text(Test1))

No errors here, but no results either. 


1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Berry_101 ,

Could you please share a bit more about the data structure of the Test collection?

How many records existed under the nested "value" column? Single one or Multiple?

 

Based on the formula that you mentioned, I think there is something wrong with it. The "value" column in your Test collection is a Table type or record type, the value.Test1 or value.Test2 formula would return a Table result rather than a Text result.

 

If the nested "value" column is a record type (contain single one record), you should modify your ForAll formula as below:

ForAll(
        Test.value; 
        Patch(
             'SharePoint_List'; 
              Defaults('SharePoint_List'); 
             {
               SP_Test1: value.Test1; 
               SP_Test2: value.Test2
             }
        )
)

 

If the nested "value" type is a Table type (contains multiple records), please modify your formula as below (nested ForAll formula):

ForAll(
        Test.value;
        ForAll(
               value.Value;
               Patch(
                     'SharePoint_List'; 
                      Defaults('SharePoint_List'); 
                      {
                         SP_Test1: Value.Test1; 
                         SP_Test2: Value.Test2
                      }
                )
        )
)

 

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-xida-msft
Community Support
Community Support

Hi @Berry_101 ,

Could you please share a bit more about the data structure of the Test collection?

How many records existed under the nested "value" column? Single one or Multiple?

 

Based on the formula that you mentioned, I think there is something wrong with it. The "value" column in your Test collection is a Table type or record type, the value.Test1 or value.Test2 formula would return a Table result rather than a Text result.

 

If the nested "value" column is a record type (contain single one record), you should modify your ForAll formula as below:

ForAll(
        Test.value; 
        Patch(
             'SharePoint_List'; 
              Defaults('SharePoint_List'); 
             {
               SP_Test1: value.Test1; 
               SP_Test2: value.Test2
             }
        )
)

 

If the nested "value" type is a Table type (contains multiple records), please modify your formula as below (nested ForAll formula):

ForAll(
        Test.value;
        ForAll(
               value.Value;
               Patch(
                     'SharePoint_List'; 
                      Defaults('SharePoint_List'); 
                      {
                         SP_Test1: Value.Test1; 
                         SP_Test2: Value.Test2
                      }
                )
        )
)

 

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (3,785)