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.
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,
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})
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,
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
)
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:
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})
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,
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.
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2