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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Parameter for the flow...
Power Apps
Answered

Parameter for the flow in power app flow

(0) ShareShare
ReportReport
Posted on by Microsoft Employee
2 seconds ago

Hi Everyone 

 

I need to run a flow a when the user clicks on the submits button 

Onselect of my submit 

ForAll(
MyCollection,
Patch(
'PR INTENT LIST',
Defaults('PR INTENT LIST'),
{
'Employee Name': DataCardValue1_1.Text,
'Mail ID': DataCardValue3_1.Text,
'Entity ': DataCardValue13_1.Text,
MaterialCode: ThisRecord.MaterialCode,
Type: ThisRecord.Type,
Description: ThisRecord.Description,
HSNCode: ThisRecord.HSNCode,
Make: ThisRecord.Make,
UOM: ThisRecord.UOM,
'Unit Rate ': Value(ThisRecord.Unit),
Quantity: Value(ThisRecord.Quantity),
Amount: Value(ThisRecord.Amount)
}
)
);
Clear(MyCollection);
NewForm(Form1_1);
PRIntentSecondScenarioFlow.Run(ItemID) *flow parameter is not working

 

 

My Flow -  PRIntentSecondScenarioFlow

Emptyglasses_0-1677497982976.png

Anyhelp on this would be much appreciated

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    Would you like to get the item that the form just updated in the list? However, since the Patch function is within a ForAll loop, it will update multiple items in the list, there would be multiple item IDs according to the number of collection entries.

     

    Please try below formula instead:

    ForAll(
    MyCollection,
    Set(varLastP,Patch(
    'PR INTENT LIST',
    Defaults('PR INTENT LIST'),
    {
    'Employee Name': DataCardValue1_1.Text,
    'Mail ID': DataCardValue3_1.Text,
    'Entity ': DataCardValue13_1.Text,
    MaterialCode: ThisRecord.MaterialCode,
    Type: ThisRecord.Type,
    Description: ThisRecord.Description,
    HSNCode: ThisRecord.HSNCode,
    Make: ThisRecord.Make,
    UOM: ThisRecord.UOM,
    'Unit Rate ': Value(ThisRecord.Unit),
    Quantity: Value(ThisRecord.Quantity),
    Amount: Value(ThisRecord.Amount)
    }
    ));PRIntentSecondScenarioFlow.Run(varLastP.ID)
    );
    Clear(MyCollection);
    NewForm(Form1_1);
    

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi, 

     

    Thanks for your response 

    Is their is any way that could get multiple items with the single ID 

    The formula which u have shared is working perfectly fine , but the flow is running for each ID 

    How do I get the multiple  items submitted  by a user in the form into the flow if I need to do that?

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    If that case you can use a collection than the variable to gather all IDs of the submitted items. The collection is of type table/array, then you can concatenate all IDs in to a single line of string and pass to flow:

    Clear(Collection2);ForAll(
    MyCollection,
    Collect(Collection2,Patch(
    'PR INTENT LIST',
    Defaults('PR INTENT LIST'),
    {
    'Employee Name': DataCardValue1_1.Text,
    'Mail ID': DataCardValue3_1.Text,
    'Entity ': DataCardValue13_1.Text,
    MaterialCode: ThisRecord.MaterialCode,
    Type: ThisRecord.Type,
    Description: ThisRecord.Description,
    HSNCode: ThisRecord.HSNCode,
    Make: ThisRecord.Make,
    UOM: ThisRecord.UOM,
    'Unit Rate ': Value(ThisRecord.Unit),
    Quantity: Value(ThisRecord.Quantity),
    Amount: Value(ThisRecord.Amount)
    }
    ).ID));
    PRIntentSecondScenarioFlow.Run(Concat(Collection2, Value, ",");
    Clear(MyCollection);
    NewForm(Form1_1);

     

    Then in the flow, get the input string and Compose with a split expression and revert it to array:

    split(triggerBody()['text'], ',')

     

    then you can use Apply to each to loop on this array to get each ID or else.

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Thanks for replying 

    Could u please be detail the changes in the flow 

    I struggled to fully comprehend that reasoning.

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    Basically it's like below:

    vjefferni_0-1677561841434.png

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    But how we get the list of multiple items submitted by the user 

    I tried the same , but its showing an error for Get Item ID 

    Emptyglasses_0-1677562898717.pngEmptyglasses_1-1677562916450.pngEmptyglasses_2-1677562964316.png

     

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    There may be same mistakes of the code in your App. You can check the collection values from the place in below screenshot:

    vjefferni_0-1677563670408.png

     

    Based on your flow run history, it has only got a true value from your App.

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Yeah I checked each and every collection when I got that error, but its working perfectly fine  

    Emptyglasses_0-1677564125796.png

     

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    My collection:

    vjefferni_0-1677566123212.png

    Flow trigger OnSelect of button:

    vjefferni_3-1677566239184.png

     

    My flow:

    vjefferni_1-1677566152014.png

     

    Please share the codes on your end.

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi ,

     

    Thanks for pointing me in the right direction .

    I changed the formula a bit 

    ForAll(
    MyCollection,
    Collect(
    Collection2,
    Patch(
    'PR INTENT LIST',
    Defaults('PR INTENT LIST'),
    {
    'Employee Name': DataCardValue1_1.Text,
    'Mail ID': DataCardValue3_1.Text,
    'Entity ': DataCardValue13_1.Text,
    MaterialCode: ThisRecord.MaterialCode,
    Type: ThisRecord.Type,
    Description: ThisRecord.Description,
    HSNCode: ThisRecord.HSNCode,
    Make: ThisRecord.Make,
    UOM: ThisRecord.UOM,
    'Unit Rate ': Value(ThisRecord.Unit),
    Quantity: Value(ThisRecord.Quantity),
    Amount: Value(ThisRecord.Amount)
    }
    ).ID
    )
    );
    PRIntentThirdScenarioFlow.Run(
    Concat(
    Collection2,
    Value,
    ","
    )
    );
    Clear(MyCollection);
    Clear(Collection2);
    NewForm(Form1_2)

    * I closed the bracket for flow run 
    earlier - PRIntentTestScenarioFlow.Run(Concat(Collection2,Value,",")
    now - PRIntentThirdScenarioFlow.Run(Concat(Collection2,Value,","))
    and bring down the clear collection2 from the beginning to end

     

    I appreciate your help because without it, I never would have come this far.

    Nobody cooperates with us to resolve the problem; everyone just put some comments  and leaves.

    A platform like this needs men like you.

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard