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

Community site session details

Session Id : KWE6uZCH3/1I4HzZF4Wpm+
Power Apps - Building Power Apps
Answered

Dialog Popup with Input Text

Like (0) ShareShare
ReportReport
Posted on 7 Jul 2020 00:32:06 by Microsoft Employee

I am trying to create a pop up dialog to get input text then save to a field in the SharePoint list.  OnSelect for the  button to confirm I have been trying to use the Set() or SetProperty() function but looks like still getting syntax error and have tried multiple things.  Any tips would be great.

  • v-xida-msft Profile Picture
    on 09 Jul 2020 at 01:12:39
    Re: Dialog Popup with Input Text

    Hi @Halstead ,

    If the solution I provided above is helpful in your scenario, please also consider go ahead to click "Accept as Solution" to identify my solution as helpful.

     

    Best regards,

  • Verified answer
    Halstead Profile Picture
    Microsoft Employee on 08 Jul 2020 at 23:53:14
    Re: Dialog Popup with Input Text

    After narrowing down to function calls it didn't accept, here is what finally worked for me to save the cancel reason and flag to selected value.  Didn't need SaveForm since Patch does this save, didn't need Navigate since showPopup: false accomplishes.  I had to use the names for fields as they appear in the table i.e. 'Cancel Reason' not the text variable names in PowerApps. Thanks for tips.

     

    Patch(
    'Procurement Database',
    SharePointIntegration.Selected,
    {
    'Cancel Reason': DeleteReasonInput.Text,
    'Cancel Flag': true
    }
    );
    Reset(DeleteReasonInput);
    UpdateContext({showPopup: false})

     

     

  • v-xida-msft Profile Picture
    on 08 Jul 2020 at 01:28:46
    Re: Dialog Popup with Input Text

    Hi @Halstead ,

    Based on the formula that you mentioned, I think there is something wrong with it. If you want to update an existing record using Patch function, the second argument should be specified a record you want to update.

     

    I have made a test on my side, please consider modify your formula as below:

    Patch(
     'Procurement Database', 
     SharePointIntegration.Selected, // Modify formula here
     {
     eCancelReasonValue: DeleteReasonInput.Text,
     eCancelFlagValue: true
     }
    );
    Reset(DeleteReasonInput);
    SaveForm(SharePointForm1_1);
    UpdateContext({showPopup: false});
    Navigate(
     ListScreen,
     Fade
    )

    or

    Patch(
     'Procurement Database', 
     LookUp('Procurement Database', ID = SharePointIntegration.SelectedListItemID), // Modify formula here
     {
     eCancelReasonValue: DeleteReasonInput.Text,
     eCancelFlagValue: true
     }
    );
    Reset(DeleteReasonInput);
    SaveForm(SharePointForm1_1);
    UpdateContext({showPopup: false});
    Navigate(
     ListScreen,
     Fade
    )

    Note: I assume you custom a form in your SP List using PowerApps.

     

    Please consider take a try with above solution, check if the issue is solved.

     

    Best regards,

  • Halstead Profile Picture
    Microsoft Employee on 07 Jul 2020 at 21:47:09
    Re: Dialog Popup with Input Text

    Thanks, I think mine is closer now, but now sure how to make the OnSelect for the button to update the current record in context?  See text in red

     

    Patch('Procurement Database', 'Procurement Database'.Selected.Id,
    {
    eCancelReasonValue: DeleteReasonInput.Text
    },{eCancelFlagValue = true}
    );
    Reset(DeleteReasonInput); SaveForm(SharePointForm1_1);
    UpdateContext({showPopup: false});
    Navigate(
    ListScreen,
    Fade
    )

  • v-xida-msft Profile Picture
    on 07 Jul 2020 at 07:09:01
    Re: Dialog Popup with Input Text

    Hi @Halstead ,

    Could you please share a bit more about your formula?

    Do you want to show up a Dialog Pop-up Box when you press a button, to collect user entry?

     

    I have made a test on my side, please consider take a try with the following workaround:

    8.JPG

    Firstly, you could add several basic controls in your app, e.g. Rectangle Icon, buttons, Label, Text Input box, ...., then make them into a Group control (press "Ctrl" + "G" hotkey, or go to "Home"-> "Group"-> "Group" option) as above screenshot.

    Set the OnSelect property of the "Entry" button to following:

    UpdateContext({ShowPopUpBox: !ShowPopUpBox})

     

    Set the Visible property of the Group1 control to following:

    ShowPopUpBox

    Set the OnSelect property of the "Submit" button to following:

    Patch( // use Patch function to collect entered Text Input box value back to your data source 
     ProductsCollection, // ProductsCollection represents my data source, please replace it with your own data source
     Defaults(ProductsCollection), 
     {
     ProductName: ProductNameTextBox.Text
     }
    );
    Reset(ProductNameTextBox)

    Set the OnSelect property of the "Cancel" button to following:

    UpdateContext({ShowPopUpBox: !ShowPopUpBox})

    Test.gif

     

    More details about configuring a Pop-up dialog box in PowerApps, please check the following video resource:

    https://www.youtube.com/watch?v=OIiMeKWRuuk

     

    Best regards,

  • anabananei Profile Picture
    195 on 07 Jul 2020 at 01:07:47
    Re: Dialog Popup with Input Text

    Do you want to show a dialog box on click of a button?

     

    For this scenario, you have to use UpdateContext property.

     

    I can suggest: 

    Step 1: OnSelect of the button, UpdateContext({showpopup:true})

    Step 2: Add rectangle icon

    Step 3: Add text Input control, placed on top of the rectangle

    Step 4: Add a cancel button, placed on top of the rectangle, not overlapping with the text input control

    Step 4.1: CancelButton OnSelect, UpdateContext({showpopup:false})

    Step 5: Add Submit Button, OnSelect, (Patch your data formula); UpdateContext({showpopup:false})

    Step 6: Group the four objects above

    Step 7: Select the group, Visible property, add showpopup

     

    You will be able to show the dialog box by hitting your trigger button, then close it by hitting cancel.  Click submit then the data will be patched to your data source and the dialog box will close.

     

    Hope this helps.

     

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete