cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Re: I need an Update if Else?

I've just been playing with forms and for me, IsBlank(myFormName) gives me a false output regardless of whether I'm editing the form or creating a new record - so, a blank form gives me the same reading as a full one.  Seeming to indicate that it's not performing as you think?  Create a text field to output the value, or pass it to a Notify to validate it...?

Rinceward
Level: Powered On

Re: I need an Update if Else?

I removed the IsBlank sp my code is now

 

UpdateIf(Table1_14, Name =DataCardValue1.Text && Time_x0020_Out<>Blank() && Time_x0020_In="",{Time_x0020_In:Clock_5.Text, Location: "On Site"}); SubmitForm(Form2); Notify("Form")

 

I have tried encapulatin git within an It statement but it always seems to accept if there is no argument within the table to create a new entery. If there is a valid record to be updated, it updates it and then creates a new record. Almost as you said do this then do this. I have broken it up and it completes each separately with a notification. With that I seen one notification pop up then the other.

 

It is almost as though it isn't recognising the ELSE part of the statement.

 

Rince

Rinceward
Level: Powered On

Re: I need an Update if Else?

Sorry the last post seemed a little garbelled. I must be losing my mind trying to find the solution.

 

If(!IsBlank(DataCardValue1), UpdateIf(Table1_14, Name =DataCardValue1.Text && Time_x0020_Out<>Blank() && Time_x0020_In="",{Time_x0020_In:Clock_5.Text, Location: "On Site"});Notify ("Update"); SubmitForm(Form2)&& Notify("Form"))

 

From this code if is change the semi colon in front of Submit form to a comma Powerapps completely ignores the submit form statement. If I leave it as it is powerapps will update then create a new entery. with a notification of Update then Form appearing.

 

I know it cannot be to far from what I need but I am sure I cannot see it for looking.

 

PhilAshby your knowledge is great and thanks for trying to lead the blind through this. It is the last piece of my app I cannot get working

Rinceward
Level: Powered On

Re: I need an Update if Else?

Would I be able to create an independant varible to check if 

Table1_14, Name =DataCardValue1.Text && Time_x0020_Out<>Blank() && Time_x0020_In=""

I am not sure how to do this one though

 

Then on the submit button, call that varible

 

If (Check=true(Update (Table1_14, {Time_x0020_In:Clock_5.Text, Location: "On Site"}),Submit form(Form2));

Navigate(Thank you screen, Transition.fade)

 

Not sure if that is exactly the right code but I think it illustrates what I am thinking

Rinceward
Level: Powered On

Re: I need an Update if Else?

OK now I have tried to add a varible to help.

So when the page loads it runs

 

UpdateContext({Var:false})

 

When data is entered into the DataCardValue1 of the form, OnChange, it runs

 

If(!IsBlank(DataCardValue1),UpdateIf(Table1_14, Name =DataCardValue1.Text && Time_x0020_Out<>Blank() && Time_x0020_In="",{Time_x0020_In:Clock_5.Text, Location: "On Site"}),
UpdateContext({Var:true}))

 

When button is pressed OnSelect Runs

 

If(Var=false,SubmitForm(Form2)&& Notify("Form"),Notify("Update"))

 

It still amends the record in the table and then adds a new record.

 

All I want is for it to do one or the other lol

 Rince

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,959)