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 Automate / from two flows only on...
Power Automate
Suggested Answer

from two flows only one flow is executing

(1) ShareShare
ReportReport
Posted on by 22
in power apps on buttonselect, has to execute two flows, one is insert and second is update. insert flow is executing and update flow is skipping.
 
In power apps using tables from azure databricks. created flows using parse Json for insert and update.
 

Delete__DEP.Run(TextInput2_4.Text);
Refresh('TableDEP');
If(IsBlank(DatePicker4.SelectedDate) || IsBlank(TextInput15_5.Text), Notify("message ",NotificationType.Error),
If(CountRows(checkescdep) =0
,Notify("Please Select at least one Escalation Check Box",NotificationType.Warning),
With(
    {
        _sr_log_ref: TextInput2_4.Text,
        _datewithnsp: TextInput15_3.Text,
        _i
    },
    ForAll(
        checkescdep,
        Collect(
            colPayloadNSP,
            {
                so_item_impact: PartNumber,
                sales_order: OrderType,
                line_number: LineNumber,
                 sr_log_ref: _sr_log_ref,
                datewithnsp: _datewithnsp,
                
            }
        )
    )
);
Set(varNSPDEPflow,
   !IsError( ForAll(colPayloadNSP,INSERT.Run(JSON(ThisRecord,JSONFormat.IgnoreUnsupportedTypes)  ) ) ) );

Set(varNSPDEPupdate,If(varNSPDEPflow,!IsError(
Set(
    payloadupdate,
    {
            
        sr_log_ref: SelectedSR,
        detailed_comment: ip_SRDetails_Detailed_Comments.Text,
          nsp_closurecomments: TextInput9_8.Text 
    }
);
UPDATE.Run(JSON(payloadupdate, JSONFormat.IncludeBinaryData));
    ),false));
//Set(varNSPDEPupdate,If(varNSPDEPflow, !IsError(SR_UPDATE.Run(JSON(payloadupdate, JSONFormat.IgnoreUnsupportedTypes))),false));
If(varNSPDEPflow,  varNSPDEPupdate, Set(varShowPopupDEPES,true),
Notify("Flow Execution failed SR is not Escalated, Some field values are empty",NotificationType.Error)
)));
 
Clear(colpartdata);
Clear(checkescdep);

Set(varDEPSelectAll,false);

Reset(DatePicker4);
Reset(TextInput15_5);
 
 
given some field values only. insert part executing, update skipping.
I have the same question (0)
  • Suggested answer
    VASANTH KUMAR BALMADI Profile Picture
    313 on at

    Instead of chaining everything into one condition, separate the insert and update clearly.

    Run insert → then run update independently:

    ForAll(
        colPayloadNSP,
        INSERT.Run(JSON(ThisRecord, JSONFormat.IgnoreUnsupportedTypes))
    );
    Set(
        payloadupdate,
        {
            sr_log_ref: SelectedSR,
            detailed_comment: ip_SRDetails_Detailed_Comments.Text,
            nsp_closurecomments: TextInput9_8.Text 
        }
    );
    UPDATE.Run(JSON(payloadupdate, JSONFormat.IncludeBinaryData));
     
    This way you’re not depending on varNSPDEPflow to allow the update.
  • Suggested answer
    Valantis Profile Picture
    3,214 on at
     
    The problem is in how you are building the update payload inside !IsError(). You have Set(payloadupdate, {...}); UPDATE.Run(...) chained with a semicolon inside a single !IsError() call. Power Apps does not execute multiple statements inside a function argument like that reliably.
     
    Fix:
     
    move the Set(payloadupdate) out as a separate statement before the varNSPDEPupdate Set, like this:
    Set(varNSPDEPflow, !IsError(ForAll(colPayloadNSP, INSERT.Run(JSON(ThisRecord, JSONFormat.IgnoreUnsupportedTypes)))));
    Set(payloadupdate, {
        sr_log_ref: SelectedSR,
        detailed_comment: ip_SRDetails_Detailed_Comments.Text,
        nsp_closurecomments: TextInput9_8.Text
    });
    Set(varNSPDEPupdate,
        If(varNSPDEPflow,
            !IsError(UPDATE.Run(JSON(payloadupdate, JSONFormat.IncludeBinaryData))),
            false
        )
    );
    By separating Set(payloadupdate) into its own statement first, the variable is guaranteed to be populated before UPDATE.Run() is called.
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

    💼 LinkedIn

    ▶️ YouTube

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 589

#2
Valantis Profile Picture

Valantis 459

#3
11manish Profile Picture

11manish 382

Last 30 days Overall leaderboard