web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / .Run function Optional...
Power Automate
Suggested Answer

.Run function Optional fields

(0) ShareShare
ReportReport
Posted on by 14
I have a PowerApps app to create new document sets, and I've set up a flow to create new document sets using a PowerApps trigger. The manual trigger in the flow works as expected. I've configured optional fields that can be left blank. However, in the run function within my PowerApps app, it only requests 8 out of the 12 fields. I have 4 optional fields, but I am receiving an error stating there are too many arguments. Even though these fields are optional in my flow, they are still part of the PowerApps V2 trigger. Why is this causing an error when I enter all 12?
Categories:
I have the same question (0)
  • Suggested answer
    Pstork1 Profile Picture
    68,717 Most Valuable Professional on at
    Optional fields used as parameters in a flow still need to be supplied in the run(). For optional fields you can supply a null value using a record format, but they still need to be there. For required fields a null value will throw an error.  Here's an example of a run() that sends one required and one optional value.
     
    flowname.run("text value to pass", {optionalfieldname: null})

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • DS-14111351-0 Profile Picture
    14 on at
    If I leave my optional blank it gives me an error

    {
    date_2: Text(
    DataCardValue64.SelectedDate;
    "yyyy-mm-dd"
    );
    text_3: Text(DataCardValue60.Value);
    text_4: Text(DataCardValue61.Value);
    number_1: DataCardValue65.Value
    }
     
    Full function : 

    NewDocSetManifest.Run(
    DataCardValue51.Value;
    DataCardValue188.Selected.Value;
    Text(
    DataCardValue59.SelectedDate;
    "yyyy-mm-dd"
    );
    Text(
    DataCardValue58.SelectedDate;
    "yyyy-mm-dd"
    );
    Text(
    DataCardValue63.SelectedDate;
    "yyyy-mm-dd"
    );
    Concat(
    Filter(
    DataCardValue57.SelectedItems;
    !IsBlank(Value)
    );
    Value;
    ","
    );
    DataCardValue62.Value;
    DataCardValue66.Selected.Value;
    {
    date_2: Text(
    DataCardValue64.SelectedDate;
    "yyyy-mm-dd"
    );
    text_3: Text(DataCardValue60.Value);
    text_4: Text(DataCardValue61.Value);
    number_1: DataCardValue65.Value
    }
    )

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard