Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-Action : Cannot bind argument to parameter 'Inputs' because it is null #16

Closed
acieslik opened this issue Aug 9, 2023 · 3 comments
Closed
Assignees

Comments

@acieslik
Copy link

acieslik commented Aug 9, 2023

I have a flow that is using a Switch block and does not contain an inputs value:
2023-08-09 14_29_28-InputsNull1
Then in the Helper.ps1:
$inputs = if ($action | Get-Member -MemberType Noteproperty -Name 'inputs') { $($action.inputs) } else { $null }
$inputs becomes $null
and later it will crash here...
2023-08-09 14_29_28-InputsNull2
with error:
Get-Action : Cannot bind argument to parameter 'Inputs' because it is null.
At C:\Repos\github\logicappdocs\src\New-PowerAutomateDoc.ps1:137 char:12
+ ´$Objects= Get-Action -Actions $($PowerAutomateFlowJson.properties.de´ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Get-Action], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Get-Action

acieslik pushed a commit to acieslik/logicappdocs_ac that referenced this issue Aug 10, 2023
@stefanstranger
Copy link
Owner

stefanstranger commented Aug 10, 2023

Hi @acieslik,

Thanks for sharing this issue. Fixed this with the following in branch called powerautomateissues

Helper.ps1 script

# Create PSCustomObject
        [PSCustomObject]@{
            ActionName   = $actionName
            RunAfter     = $runAfter
            Type         = $type
            Parent       = $Parent
            ChildActions = $childActions
            Inputs       = if ($inputs) {Format-HTMLInputContent -Inputs $(Remove-Secrets -Inputs $($inputs | ConvertTo-Json -Depth 10 -Compress))} else {$null}
        }

In this new branch I also added a new function called Format-HTMLInputContent that fixed issue 9

@acieslik
Copy link
Author

I cannot see that change in any available branch. Am I missing out something?

@stefanstranger
Copy link
Owner

stefanstranger commented Aug 11, 2023

I still need to push my local development branch. Going through all the issues to validate if these are now fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants