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 / Submission Form built ...
Power Apps
Answered

Submission Form built from cascading ddl must handle CRUD operations with one save icon.

(0) ShareShare
ReportReport
Posted on by 534

I have a form that performs standard CRUD operations.  I'm trying to figure out a way to use one save icon to do all the CRUD work.

This form is only updating one table in the db...

BOM Details SQL Table.png

 

The form is built using Cascading Dropdown Lists...

 

BOM Action.png

The BOM Action will determine what fields are used.

Bom Add Action.pngBOM Change Color Action.pngBOM Change Qty Action.pngBOM Change Size Action.pngBOM Delete Action.png

As you can see "Component" is a common denominator for all selections.  "BOM Ref" is use is all selections except for the "Add" BOM Action.

 

I'm not really sure how to accomplish this.  I'm not sure If I need to make use of variables or an IF or Switch statement for the Patch, OR...is this even possible with this design?

 

I'm looking for a roadmap to success with this one.  I feel I'm getting better with Powerapps and this particular app taught many valuable lessons.  This submission form has me perplexed.  

 

Any help would be greatly appreciated.

Categories:
I have the same question (0)
  • Cooper01 Profile Picture
    664 on at

    Is there a reason you can't use SubmitForm? It looks like you're using an actual form control. SubmitForm would either create a new record or update an existing record, based on the form mode and the form item property. I don't think I would use Patch for this because the fields being written change depending on what fields are shown on the form and I feel like this would get messy.

    In the actual save icon, you could switch/use if statement on selected value from the BOM action to either SubmitForm or Remove.

  • tonykiefer Profile Picture
    534 on at

    @Cooper01 the reason I can't use the Submit Form is because the Change qty is transactional...meaning...I'm not overwritting the current record but instead creating the next record with a new total.

     

    I'm trying a different approach...All things outlined above are still true.  This time I'm using the submit icon combined with a switch statement to control the use of Popups.  I have a different popup for each BOM Action.  The popups are simple - rectangle, save and cancel buttons, and a label all group together and I'm set the unique variable for two popups to false.  The save button onclick is using a switch statement to decide which popup to call, but the popups are not firing.

     

    The main dropdown that control the cascading dropdown lists is name BOM_Dropdown.

     

    Switch(
    BOM_Dropdown.SelectedText.Value,
    "", false,
    "Copy From", Set(varCopyBOMPopup,true),
    "Add", Set(AddBOM_Group,true),

    "unknown"
    )

     

    This doesn't change the local variables and the neither of the popups will render.

  • Cooper01 Profile Picture
    664 on at

    Maybe this is obvious but I didn't notice you mention updating the Visible properties of the controls in the pop ups. I'm assuming those are all set to either varCopyBOMPopup or AddBOM_Group?

     

    Also Set is for a global variable while UpdateContext is for a local, so could be two different variable types with the same name.

  • tonykiefer Profile Picture
    534 on at

    I changed the switch statement to use the UpdateContext.  That was a rookie mistake...

    Switch(
    BOM_Dropdown.SelectedText.Value,
    "Copy From", UpdateContext({varCopyBOMPopup:true}),
    "Add", UpdateContext({varAddBOMPopup:true}),
    "unknown"
    )

     

    They still don't fire.  All controls in the group are also set to their respective variables per grouping.

  • tonykiefer Profile Picture
    534 on at

    @Cooper01 

    The problem with the popups was I forgot to set the Item property of the form.  The popups are working fine now.

  • Verified answer
    tonykiefer Profile Picture
    534 on at

    Now that the popups are working, saving the transactional form data is working which is dependent on the primary dropdown selection.

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 342 Most Valuable Professional

#2
11manish Profile Picture

11manish 234

#3
Valantis Profile Picture

Valantis 187

Last 30 days Overall leaderboard