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

Showing no data after Edit second time

Hi,

 

I'm new one at PA. I'm building an app that controls my projects.

 

First screen I listed my projects (based on sharepoint list):

EduardoSantos_0-1596566133345.png

after clicking at the project, goes to 2nd screen:

EduardoSantos_1-1596566200062.png

in that screen i have some buttons on top (Novo = New; Editar = Edit). my question is about de button "Editar" or Edit.

If I click on it, my form goes to Display Mode edit and I can change whatever I want.

EduardoSantos_2-1596566464034.png

two buttons are shown on the botton of screen (Save and Cancel). So if I click on Save, it saves my edited form perfectly.

EduardoSantos_3-1596566676022.png

If I click again on Edit button, it doesn't show the data anymore.

EduardoSantos_4-1596566863480.png

here are some of my properties:

OnSelect in my gallery:

EduardoSantos_5-1596566982805.png

OnSelect in my Edit button:

EduardoSantos_6-1596567059584.png

OnSelect in my Save button:

EduardoSantos_7-1596567140896.png

 

 

What Am I doing wrong?

 

thaks.

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @EduardoSantos ,

Do you mean that if you click the edit button after you save the form, the form will display nothing?

The reason why you met this problem is that:
if you change the form's mode from view to edit, the form's lastsubmit item will be cleared.

So formname.LastSubmit actually represents blank value. If one edit form's Item is blank, it will display "no item to display".

The solution is: save the formname.LastSubmit as a variable after you submit the form. If you click that edit button, make the form display that variable.

I've made a similar test for your reference:

1)gallery's OnSelect:

EditForm(Form1);Set(mode,"edit")

2)add button's OnSelect:

NewForm(Form1)

3)form's Item:

If(mode="edit",Gallery1.Selected,mode="view"&&!IsBlank(Form1.LastSubmit),Form1.LastSubmit,mode="view"&&IsBlank(Form1.LastSubmit),item)

//if you click the edit button the first time, you will view the selected item.

If you click the save button, you will view the last submit item.

If you click the edit button again, the form's lastsubmit item will be blank. So you will view the variable item(which is the last submit item) 

4)save button's OnSelect:

SubmitForm(Form1);ViewForm(Form1);Set(mode,"view");Set(item,Form1.LastSubmit)

5)edit button's OnSelect:

EditForm(Form1)

 

 

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

10 REPLIES 10
cds
Impactful Individual
Impactful Individual

OnSuccess (Form) = ResetForm(Form)

where should i write this?

cds
Impactful Individual
Impactful Individual

YourForm.OnSuccess

EduardoSantos
Frequent Visitor

I forgot this, propieties ITEM on my form

EduardoSantos_0-1596568510898.png

 

Now, it goes to "Nothing" at first time I saved. Not worked.

cds
Impactful Individual
Impactful Individual

What is in Default of Form property?

DefaultMode = View

cds
Impactful Individual
Impactful Individual

GalleryiaProjectos is on a different screen?

 

try setting onselect of that gallery to Set(varItem, ThisItem)

 

Then in the Item change galleria.selected to varItem

v-yutliu-msft
Community Support
Community Support

Hi @EduardoSantos ,

Do you mean that if you click the edit button after you save the form, the form will display nothing?

The reason why you met this problem is that:
if you change the form's mode from view to edit, the form's lastsubmit item will be cleared.

So formname.LastSubmit actually represents blank value. If one edit form's Item is blank, it will display "no item to display".

The solution is: save the formname.LastSubmit as a variable after you submit the form. If you click that edit button, make the form display that variable.

I've made a similar test for your reference:

1)gallery's OnSelect:

EditForm(Form1);Set(mode,"edit")

2)add button's OnSelect:

NewForm(Form1)

3)form's Item:

If(mode="edit",Gallery1.Selected,mode="view"&&!IsBlank(Form1.LastSubmit),Form1.LastSubmit,mode="view"&&IsBlank(Form1.LastSubmit),item)

//if you click the edit button the first time, you will view the selected item.

If you click the save button, you will view the last submit item.

If you click the edit button again, the form's lastsubmit item will be blank. So you will view the variable item(which is the last submit item) 

4)save button's OnSelect:

SubmitForm(Form1);ViewForm(Form1);Set(mode,"view");Set(item,Form1.LastSubmit)

5)edit button's OnSelect:

EditForm(Form1)

 

 

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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

Top Solution Authors
Top Kudoed Authors
Users online (98,072)