cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
henkenTech
Resolver II
Resolver II

SharePoint List Schema and Components

Hi all,

 

hope you are well! I have been sitting over this for hours now and I just cannot understand why this isn't working:

  1. I have an SPO list as a source;
  2. OnStart() is used to store ShowColumns() for that data source to a collection as follows:

 

 

ShowColumns(
        'User Journeys',
        "ID",
        "Path",
        "StepLabel",
        "PreviousSteps",
        "Conditions",
        "StepType",
        "Options",
        "ScreenForwarding",
        "Variable",
        "LookUpFilter",
        "UnitOptions",
        "Title"
    )

 

 

  • The resulting collection when viewed as a JSON() is:

 

 

[
    {
        "Conditions": [
            {
                "Value": "Always"
            }
        ],
        "ID": 2,
        "LookUpFilter": "test",
        "Options": [
            {
                "Id": 3,
                "Value": "Amendment"
            },
            {
                "Id": 7,
                "Value": "Buying"
            }
        ],
        "Path": {
            "Value": "HOME"
        },
        "PreviousSteps": [
            {
                "Id": 1,
                "Value": "HOME: Topic Selection"
            }
        ],
        "ScreenForwarding": {
            "Value": "Home"
        },
        "StepLabel": "HOME: Example",
        "StepType": {
            "Value": "Tiles"
        },
        "Title": "Example",
        "UnitOptions": [
            {
                "Value": "GBP"
            },
            {
                "Value": "USD"
            }
        ],
        "Variable": "test"
    }
]

 

 

  • I need to load this into a Component as an input variable and to be able to use these fields, I provided the following sample schema in the component advanced settings:

 

 

Table(
    {
        Conditions: [
            {
                Value: "Always"
            }
        ],
        ID: 2,
        LookUpFilter: "test",
        Options: [
            {
                Id: 3,
                Value: "Amendment"
            },
            {
                Id: 7,
                Value: "Buying"
            }
        ],
        Path: {
            Value: "HOME"
        },
        PreviousSteps: [
            {
                Id: 1,
                Value: "HOME: Topic Selection"
            }
        ],
        ScreenForwarding: {
            Value: "Home"
        },
        StepLabel: "HOME: Example",
        StepType: {
            Value: "Tiles"
        },
        Title: "Example",
        UnitOptions: [
            {
                Value: "GBP"
            },
            {
                Value: "USD"
            }
        ],
        Variable: "test"
    }
)

 

 

  • If I now set the collection as the input variable for the component, I get the "not the right record structure" error. When I pass the example schema, it works just fine. 

What am I missing here??! I have tried literally everything. Is there some weird invisible property in collection I cannot see?

 

Any pointers are greatly appreciated 🙂

 

Max

1 ACCEPTED SOLUTION

Accepted Solutions
henkenTech
Resolver II
Resolver II

I finally found the issue.... [] is not the same as Table(). I had to change the schema kin my component to:

Table(
    {
        Conditions: Table(
            {
                Value: "Always"
            }
        ),
        ID: 2,
        LookUpFilter: "test",
        Options: Table(
            {
                Id: 3,
                Value: "Amendment"
            },
            {
                Id: 7,
                Value: "Buying"
            }
        ),
        Path: {
            Value: "HOME"
        },
        PreviousSteps: Table(
            {
                Id: 1,
                Value: "HOME: Topic Selection"
            }
        ),
        ScreenForwarding: {
            Value: "Home"
        },
        StepLabel: "HOME: Example",
        StepType: {
            Value: "Tiles"
        },
        Title: "Example",
        UnitOptions: Table(
            {
                Value: "GBP"
            },
            {
                Value: "USD"
            }
        ),
        Variable: "test"
    }
)

View solution in original post

2 REPLIES 2
henkenTech
Resolver II
Resolver II

I finally found the issue.... [] is not the same as Table(). I had to change the schema kin my component to:

Table(
    {
        Conditions: Table(
            {
                Value: "Always"
            }
        ),
        ID: 2,
        LookUpFilter: "test",
        Options: Table(
            {
                Id: 3,
                Value: "Amendment"
            },
            {
                Id: 7,
                Value: "Buying"
            }
        ),
        Path: {
            Value: "HOME"
        },
        PreviousSteps: Table(
            {
                Id: 1,
                Value: "HOME: Topic Selection"
            }
        ),
        ScreenForwarding: {
            Value: "Home"
        },
        StepLabel: "HOME: Example",
        StepType: {
            Value: "Tiles"
        },
        Title: "Example",
        UnitOptions: Table(
            {
                Value: "GBP"
            },
            {
                Value: "USD"
            }
        ),
        Variable: "test"
    }
)
Eelman
Community Champion
Community Champion

@henkenTech 

Try using a variable instead of a collection (even though collections are technically a variable ...)

 

Set(
    mySchema,
    Mid(
        // change colName to the collection name from your OnStart
        JSON(colName),
        2,
        Len(JSON(colName)) - 2
    )
)
  

 

Then send the variable mySchema to your component. Haven't tried this myself, just offering a possible solution.

Helpful resources

Announcements
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.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (3,278)