Issues with Add-UDElement

Hi all! Can someone explain to me what I’m doing wrong here. I have two columns, with id’s named ‘LeftColumn’ and ‘RightColumn’. I have a UDInput on the left column and in the endpoint, I’m trying to use Add-Element with the parent ID set to the RightColumn and can’t figure out why it’s not working.

Using Add-Element and Set-Element has already been hit or miss it seems, so I’m not sure if it’s something I’m doing wrong or what.

Any help is appreciated!

New-UDPage -Name "Homepage" -Content {

    New-UDRow {

        New-UDColumn -Id 'LeftColumn' -LargeSize 6 -Content {

            New-UDCard -Endpoint {

                New-UDInput -Title 'Test' -Endpoint {

                    param([String]$Test)

                    Add-UDElement -ParentId 'RightColumn' -Content {

                        New-UDCard -Title 'Success' -Content {

                            $Test

                        }

                    }

                }

            }

        }

        New-UDColumn -Id 'RightColumn' -LargeSize 6 -Content {

        

        }

    }

}

That should work. Can you let me know what version of UD you are running?

@adam Thanks for the validation that it SHOULD work!! I’ve been racking my brain for a couple of hours in the docs lol.

2.2.0 - UniversalDashboard.Community

@adam Also, I’ve tested a few other things and for some reason, Add and Set-UDElement are not working as it should.

I’ve tried creating a blank UD element within a column and setting it with the ID of RightColumn working. Like:

New-UDElement -Tag 'p' -Attributes @{'id'='RightColumn'}

and then within the endpoint of an input doing:

Set-UDElement -Id 'RightColumn' -Content {'test'}

I’ve had issues with this in the past, but was able to tinker until something worked. I always thought it was a lack of understanding on my part. Thanks for any help you can provide!

@RandallEverhart - Can you try it like this:

    $Page = New-UDPage -Name "Homepage" -Content {

        New-UDRow {
    
            New-UDColumn -Id 'LeftColumn' -LargeSize 6 -Content {
    
                New-UDCard -Endpoint {
    
                    New-UDInput -Title 'Test' -Endpoint {
    
                        param([String]$Test)
    
                        Add-UDElement -ParentId 'RightColumn' -Content {
    
                            New-UDCard -Title 'Success' -Content {
    
                                $Test
    
                            }
    
                        }
    
                    }
    
                }
    
            }
    
            New-UDColumn -Id 'RightColumn' -LargeSize 6 -Content {
                New-UDElement -Id 'RightColumn' -Tag 'div' -Content {
                    
                }
            
    
            }
    
        }
    
    }

    New-UDDashboard -Title "Material UI Test" -Pages $Page 

That worked for me. When I look at the Id of the React element that New-UDColumn produces, it’s not setting the Id correctly :frowning:

@adam It’s working for me as well. Thanks for your assistance!