cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LyonsBI_BRL
Resolver I
Resolver I

The Method Run has and invalid parameter - from drop down

I'm working on sending several parameters to a PowerAutomate flow. 

 

The variables for the Power Automate Flow is set to capture a String

LyonsBI_BRL_0-1646912875339.png

In my items for the Pistol / Select (this is for an ATF form) I'm running the following below from my drop down menu to select either two types of categories.

If(IsBlank(Manufacture3.Text),Blank(),Distinct(PistolType.PistolType,PistolType))

When I go to submit the information, it keeps erroring out saying the following below

LyonsBI_BRL_2-1646913062026.png

This message keeps popping up when ever I attempt to run my Power Automate flow, with the OnSelect statement shown below.

Set(varShowSpinner, true);
MultiplePistolTransferPDFGenerator.Run(
    DateForm.SelectedDate,
    DateForm_7.SelectedDate,
    Last_First_MiddleMPFT.Text,
    FirstNameMPT.Text,
    LastNameMPT.Text,
    MiddleMPT.Text,
    DriversLicenseNumber.Text,
    DriversLicense.Text,
    DateofBirth.SelectedDate,
    SexSelect.SelectedText.Result,
    Hispanic.Value,
    NonHispanic.Value,
    AmericanIndian.Value,
    Asian.Value,
    Native.Value,
    Black.Value,
    White.Value,
    SexSelect.SelectedText.Result,
    Name_of_Agency.Text,
    Agency_Address_City_State.Text,
    EmployeeFillingoutForm.Text,
    FormWasCompleted.SelectedDate,
    Manufacture1.Text,
    Model1.Text,
    SerialNumber1.Text,
    PistolSelect1.SelectedText.Result,
    CaliberSelect1.SelectedText.Result,
    Dateform_1.Text,
    Manufacture2.Text,
    Model2.Text,
    SerialNumber2.Text,
    PistolSelect2.SelectedText.Result,
    CaliberSelect2.SelectedText.Result,
    Dateform_2.Text,
    PlaceofBirthCityStateCountry.Text,
    WA_State.Text,
    TransfereeAddress.Text,
    Manufacture3.Text,
    Model3.Text,
    SerialNumber3.Text,
    PistolSelect3.SelectedText.Value,
    CaliberSelect3.SelectedText.Result,
    Dateform_3.Text,
    Manufacture4.Text,
    Model4.Text,
    PistolSelect4.SelectedText.Result,
    SerialNumber4.Text,
    CaliberSelect4.SelectedText.Result,
    Dateform_4.Text,
    Manufacture5.Text,
    Model5.Text,
    SerialNumber5.Text,
    PistolSelect5.SelectedText.Result,
    CaliberSelect5.SelectedText.Result,
    Dateform_5.Text,
    Manufacture6.Text,
    Model6.Text,
    SerialNumber6.Text,
    PistolSelect6.SelectedText.Result,
    CaliberSelect6.SelectedText.Result,
    Dateform_6.Text,
    ConnectedYES.Value,
    ConnectedNO.Value   
);
Set(varShowSpinner, false);

  

Basically I want to be able to pass in a NULL value here if nothing is selected, though it keeps giving me that error. Any suggestion would be greatly appreciated. 

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Figured it out! What I did was create a blank value in SQL in my table for Pistol and Caliber select. Thus when I have no value there, that works and it goes right through. Problem solved 🙂 

View solution in original post

11 REPLIES 11
larschrjensen
Frequent Visitor

If I have to guess I'd say you'd want this:

 PistolSelect3.SelectedText.Value,

to instead be:

 PistolSelect3.SelectedText.Result,

 

Just tried that, same error if I set it to .Value instead of .Result

ansrikanth
Resolver III
Resolver III

Sorry, a bit confused here.. what is the Type3 you are setting ? 

 

If this is what you used to set the Type3 value 

If(IsBlank(Manufacture3.Text),Blank(),Distinct(PistolType.PistolType,PistolType))

then why can't you simply change this to 

If(IsBlank(Manufacture3.Text),"",Distinct(PistolType.PistolType,PistolType))

 

Orelse, you have an option to check the value in the powerautomate it self and set it to empty instead of null.

 

Thank you

-Srikanth

ansrikanth
Resolver III
Resolver III

And also, If I were to design this - I would not set these many params to PowerAutomate, which is not only confusing & un readable but also difficult to extend. I would rather use a JSON formatted text and send it as a record to the Powerautomate.

 

Thank you

-Srikanth

Yeah just tried that as well, still no go - 

LyonsBI_BRL_0-1646918943022.png

 

ansrikanth
Resolver III
Resolver III

Could you please expand where you are using this formula (on what event) and what is the error and how its been used to send to Power Automate?

 

Thank you

-Srikanth

@ansrikanth can you elaborate a bit regarding what you are looking for here? Just so I know what I need to send back here to make a bit more sense as to what I'm trying to do.

 

Thanks!

ansrikanth
Resolver III
Resolver III

I Understand you are sending some parameters to a Power automate flow, one of the parameter is sending a Null value which is causing problem in the power automate to set a string variable.

What I didn't understand is where you are using the formula 

If(IsBlank(Manufacture3.Text),Blank(),Distinct(PistolType.PistolType,PistolType))

and how it is related to your power automate flow.

 

Thank you

-Srikanth

Not really related, the reason I was doing it that was way was to force the NULL value, from the error I was getting. For getting the items for that dropdown list, usually I'll use

Distinct(PistolType.PistolType,PistolType)

 

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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,360)