cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
gfaraci1
Level: Power Up

Created New Child Item and Navigate to Edit

I have created a flow in powerapps that when you click a button it creates a child item in a different list with the ID of that item listed in a column. After it does this the app should bring you to the edit screen of the child item that you just created. Right now I have it going to the edit page but not for the item created. Current button formula is:

 

CreateJudgeItem.Run(SubmissionID);EditForm(EditForm1);Navigate('Judge Item',ScreenTransition.Cover) 

 

i have the Flow collecting that ID to generate the child item, no issue there. After the item is created I initialized an int variable with the ID of the new item. I have that "Respond to Powerapps" with that variable. But I cannot figure out a way to properly pass back that variable so you are sent to the correct edit Judge Item screen.

 

 

4 REPLIES 4
Super User
Super User

Re: Created New Child Item and Navigate to Edit

@gfaraci1Try this out...

 

Set(CreateResults, CreateJudgeItem.Run(SubmissionID));
Navigate('Judge Item',ScreenTransition.Cover) 

 

Then, in your CreateResults.result variable, you will have the value you passed back from Flow.

In your 'Judge Item' screen, you can lookup the record based on the CreateResults.result value and exxecute the EditForm statement there.

 

Hope this helps some.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
gfaraci1
Level: Power Up

Re: Created New Child Item and Navigate to Edit

Yes that works to an extent. I need to navigate to the correct page on this page and not on the edit form page as that other page is navigated from another page and I don't want to disrupt that processs as well. 

 

I think I looking more for something like: 

 

Set(JudgeID,CreateJudgeItem.Run(SubmissionID));Navigate('Judge Item'.JudgeID,ScreenTransition.Cover); 

 

I know this logic works in other places but errors out here. I know the Navigate syntax is more

 

Navigate( Details, ScreenTransition.Fade, { ID: 12 } )

 

But that seems to imply from the docs that it updates the ID of the item. And since this is currently editing the first item in the child list, I don't want it update previous items and lose data. 

 

 

Community Support Team
Community Support Team

Re: Created New Child Item and Navigate to Edit

Hi @gfaraci1 ,

Could you please share a bit more about the Item property of the Edit form within your 'Judge Item' screen?

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

Set the OnSelect property of the Button control to following formula:

Set(SubmittedID, CreateJudgeItem.Run(SubmissionID).VariableName);  /* <-- The VariableName represents the variable you specified in your flow, which you want to return back your app */
EditForm(EditForm1);
Navigate('Judge Item',ScreenTransition.Cover)

Within the 'Judge Item' screen (which contains the EditForm1), set the Item property of the Edit form to following:

If(
    !IsBlank(SubmittedID),
    LookUp('YourAntherSPList', ID = SubmittedID)
)

Set the OnHidden property of the 'Judge Item' screen to following:

Set(SubmittedID, Blank())

Note: The EditForm1 within your 'Judge Item' screen connects to your another different SP list (DataSource property to 'YourAnotherSPList').

 

Best regards,

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

Re: Created New Child Item and Navigate to Edit

@gfaraci1 

You will want to either pass the result (JudgeID) as a parameter to your navigate, or, since it is a global variable, just use it on your other screen.

So, option 1 (pass as parameter) would be:

   Navigate('Judge Item',ScreenTransition.Cover, {JudgeID: CreateJudgeItem.Run(SubmissionID})

 

 

Option 2 (use the global variable) would be:

   Set(JudgeID, CreateJudgeItem.Run(SubmissionID)); Navigate('Judge Item', Cover)

 

Then, in your 'Judge Item' screen (which has the Edit Form) set the Item property to:

   Lookup(yourDataSource, ID = JudgeID)

 

The question would be - what other places do you call this 'Judge Item' screen?  You would either need to always Set the variable (option 2) or pass the ID (option 1) to the screen, or you will have inconsistent results.  If this is the only place you Navigate to this screen, no problem. Otherwise, you'll need to put some logic in to determine the correct ID to lookup and edit.

 

Hope this helps some.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

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,584)