cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BoyMom826
Frequent Visitor

Why isn't my submit button working?

Hello! 

 

I am admittingly very new to power apps. However, I've managed to create a pop-up window on my app to edit/create sharepoint items. However, I am trying to get my OK button to work - where I want it to save a new or update an existing record, close and reset my form for next use... but I click the button and nothing is working! I would be very grateful if someone could look through and see if there is something I am missing. 


Here is what I have in the OnSelect area.... I should also mention that I have the reset fields in a button on the top right to cancel, and in another button on the bottom left to delete all and those work perfectly.

 

 

// save the record back to SharePoint
Patch(
    Social_Media,
    Table(
        {
            ID: varCurrentEvent.ID,
            Post_Subject: drp_popup_Subject.Selected.Value,
            Post_Date: DatePicker1.SelectedDate,
            Local_Pages: cmb_popup_facebookpages.Selected.Value,
            Post_Time: drp_popup_postTime.Selected.Value,
            Post_Content: txt_popup_PostContent.Text,
            Notes: txt_popup_Notes.Text,
            Page_Tags: txt_popup_PageTags.Text
          }
    )
);

// hide the pop-up menu
Set(
    varShowEventForm,
    false
);

// reset all fields to default values
Reset(drp_popup_Subject);
Reset(DatePicker1);
Reset(cmb_popup_facebookpages);
Reset(drp_popup_postTime);
Reset(txt_popup_PostContent);
Reset(txt_popup_Notes);
Reset(txt_popup_PageTags);

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
BoyMom826
Frequent Visitor

Was able to figure it out! I was doing Selected.Value rather than SelectedItems on my combo box... which allows for multiple choice. Thank you all for your help in getting me closer to the answer!

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @BoyMom826 ,

Is this a new record or are you trying to update a current item? For a new record

Patch(
   Social_Media,
   Defaults(Social_Media)
   {
      Post_Subject: drp_popup_Subject.Selected.Value,
      Post_Date: DatePicker1.SelectedDate,
      Local_Pages: cmb_popup_facebookpages.Selected.Value,
      Post_Time: drp_popup_postTime.Selected.Value,
      Post_Content: txt_popup_PostContent.Text,
      Notes: txt_popup_Notes.Text,
      Page_Tags: txt_popup_PageTags.Text
   }
)

If an existing record

Patch(
   Social_Media,
   {ID: varCurrentEvent.ID},
   {
      Post_Subject: drp_popup_Subject.Selected.Value,
      Post_Date: DatePicker1.SelectedDate,
      Local_Pages: cmb_popup_facebookpages.Selected.Value,
      Post_Time: drp_popup_postTime.Selected.Value,
      Post_Content: txt_popup_PostContent.Text,
      Notes: txt_popup_Notes.Text,
      Page_Tags: txt_popup_PageTags.Text
   }
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

@WarrenBelz -Thank you so much for your help. I am currently trying to update an existing record, but will also be creating a new one, so I am glad to have help with both formulas. 

 

It unfortunately is still not working. I will update the details, then click the button, but sharepoint will not update and the popup will not close. 

 

I am also thinking that maybe I don't have my local pages set up correctly? It is referencing a lookup column from another list, could that be causing a problem? The list that it is looking up is named Facebook Pages and the specific data column is Facebook_Pages (which allows for multiple choices, if that matters at all). As of right now, that value is listed as:

Local_Pages: cmb_popup_facebookpages.Selected.Value,

 

Thank you!

Hi @BoyMom826 ,

I cannot see your data, but you are referencing control outputs in the Patch code, so where they come from should not matter. Put each one on a label - such as

cmb_popup_facebookpages.Selected.Value

 and see if you get the value you are expecting to Patch. Also note that the field types have to line up with those in the List.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

BoyMom826
Frequent Visitor

Was able to figure it out! I was doing Selected.Value rather than SelectedItems on my combo box... which allows for multiple choice. Thank you all for your help in getting me closer to the answer!

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (1,407)