cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ywliang96
Helper II
Helper II

If Statement

I created a form using CDS and Im have an Text Message that is called "Add Details" in the EditForm. I have two icons which is edit and add icons. However, the edit icon also leads to the "Add Details" screen which is incorrect. How can I change the text message from "Add Details" to "Edit Details" according to what icon the user chose without having to duplicate another screen?

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @ywliang96 ,

Do you want to use the same form to edit record and add record?

If so, the mainly important thing is to set form's mode.

I've made a similar test for your reference:

1)gallery screen

Set the arrow button's OnSelect(inside the gallery):

Naviagte(EditScreen);EditForm(Form1)   //in this way, the form's mode will be set to edit 

Set the add button's OnSelect:

Naviagte(EditScreen);NewForm(Form1)  //in this way, the form's mode will be set to new 

If you want to edit an existing record, you just need to click the item's arrow button inside the gallery.

If you want to create a new record, you just need to click the add button.10161.PNG

 

10162.PNG

 

2)edit form screen

Set the form's Item: Gallery1.Selected

Set the submit button's OnSelect:

SubmitForm(Form1)  
//no matter you are editing an existing record or creating a new record, you could both use submitform function to submit

10163.PNG

 

10164.PNG

Here's a doc about this kind of app in details for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/working-with-forms

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yutliu-msft
Community Support
Community Support

Hi @ywliang96 ,

Do you want to use the same form to edit record and add record?

If so, the mainly important thing is to set form's mode.

I've made a similar test for your reference:

1)gallery screen

Set the arrow button's OnSelect(inside the gallery):

Naviagte(EditScreen);EditForm(Form1)   //in this way, the form's mode will be set to edit 

Set the add button's OnSelect:

Naviagte(EditScreen);NewForm(Form1)  //in this way, the form's mode will be set to new 

If you want to edit an existing record, you just need to click the item's arrow button inside the gallery.

If you want to create a new record, you just need to click the add button.10161.PNG

 

10162.PNG

 

2)edit form screen

Set the form's Item: Gallery1.Selected

Set the submit button's OnSelect:

SubmitForm(Form1)  
//no matter you are editing an existing record or creating a new record, you could both use submitform function to submit

10163.PNG

 

10164.PNG

Here's a doc about this kind of app in details for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/working-with-forms

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,256)