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

Push message parameter to navigate and filter

Hi all,

 

I need some support to get my app working as intended.

I have built quite an extensive app to support the field service process flow in my business and my service mechanics have all the ongoing jobs in a gallery view from where they can update whatever needs to be updated throughout the job.

When they post an important update that need attention, a check box is checked before saving the form, which then triggers a flow that sends a push message to all users.

 

I have defined a push message parameter for the app to pick up as it is opened via the push message.
What I can't get my head around is how to use the Param("Id") to filter the selected ID without losing other functions in the app.

 

When I receive a push message I want it to open the FormView (Detail Screen) for the subject List Item and then I want to be able to use the app as if I opened it the normal way without a push message.

 

I have tried to use the Param("Id") to filter the subject Item Line, but since the I can't figure out how to "reset" the Param() the filter will persist when I navigate from- and then again back to the Detail Screen.

Any solutions or ideas are highly welcome!
Thanks in advance!
Johnny Blomgren 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Eelman
Super User
Super User

@JohnnyBlomgren 

Have you watched any Deep Linking videos? Shane Young has a good one which can be found via googling.

 

At a high level, you want to

1. Set View & Edit form Item properties to a varaiable, eg vSelectedRecord

2. App OnStart, If( !IsBlank( --parameter--), Set( vSelectedRecord, LookUp( dataSource, ID=Param(ID) ); Navigate(viewScreen, Transition.CoverRight))

3. App opens, checks if Param IsBlank

4. If it's not blank Sets variable and navigates to View screen

5. User selects back chevron, returns to gallery browse screen

6. User selects new record from gallery, OnSelect of gallery is set to 

Set( vSelectedRecord, ThisItem)

7. User moves about app as normal

 

The key I see setting your form Item property to a variable. This allows you to set the variable from anywhere in the app, not just app OnStart or Gallery.Selected. It's quite a powerful concept ... and very handy 🙂 

 

If you need further help, post some code and I'll help further.

View solution in original post

@JohnnyBlomgren 

I think I understand what's happening.

 

Try setting this code to the OnSuccess property of your form

 

Set( vSelectedRecord, yourFormName.LastSubmit)

 

What's happening is that, after you Submit your form the edited data is returned and is accessible via the LastSubmit property of the form. Sometimes, this isn't what you want users to do eg a typical process would be 

 

Submit form --> Navigate to gallery --> Item variable is reset to Blank()

 

But it seems you are wanting something different here. If that's not what you are looking for I'm happy to help further.

View solution in original post

6 REPLIES 6
Eelman
Super User
Super User

@JohnnyBlomgren 

Have you watched any Deep Linking videos? Shane Young has a good one which can be found via googling.

 

At a high level, you want to

1. Set View & Edit form Item properties to a varaiable, eg vSelectedRecord

2. App OnStart, If( !IsBlank( --parameter--), Set( vSelectedRecord, LookUp( dataSource, ID=Param(ID) ); Navigate(viewScreen, Transition.CoverRight))

3. App opens, checks if Param IsBlank

4. If it's not blank Sets variable and navigates to View screen

5. User selects back chevron, returns to gallery browse screen

6. User selects new record from gallery, OnSelect of gallery is set to 

Set( vSelectedRecord, ThisItem)

7. User moves about app as normal

 

The key I see setting your form Item property to a variable. This allows you to set the variable from anywhere in the app, not just app OnStart or Gallery.Selected. It's quite a powerful concept ... and very handy 🙂 

 

If you need further help, post some code and I'll help further.

View solution in original post

Hi @Eelman,

 

Many thanks for your support!

I struggled a bit with what I believe was related to indirect variable uses that had to be updated, and after a few trials I got it to work as intended!

For some reason it did not accept Set(vSelectedRecord, ThisItem), but Set(vSelectedRecord, Gallery.Selected) did the trick.

 

Thanks again for making my life a brighter place!

Johnny Blomgren

Hi again @Eelman 

I have a minor issue in the wake of above enhancement which perhaps you can help me with?

Navigation works fine between Gallery page, Details page and Edit page. However, when I edit an Item in the edit page then the updates does not view when moving back to the to the detail page. I need to navigate back to the gallery and select the subject Item to trigger to the Variable with updated data.
Can I somehow update (refresh) the variable vSelectedRecord?

Thanks in advance,

@JohnnyBlomgren 

I think I understand what's happening.

 

Try setting this code to the OnSuccess property of your form

 

Set( vSelectedRecord, yourFormName.LastSubmit)

 

What's happening is that, after you Submit your form the edited data is returned and is accessible via the LastSubmit property of the form. Sometimes, this isn't what you want users to do eg a typical process would be 

 

Submit form --> Navigate to gallery --> Item variable is reset to Blank()

 

But it seems you are wanting something different here. If that's not what you are looking for I'm happy to help further.

View solution in original post

@Eelman 

That worked fine! Many thanks!

Just to give you the background to this atypical process;
I am running business which is predominantly field service based. I have created an app in PowerApps where we can open service cases and all team members can actively work on those and update information as and when needed during the jobs. We can have as many as 40 - 60 cases open simultaneously and therefore it can be confusing if it takes the user back to the gallery every time an update is submitted.

Thanks again for your help!
Johnny Blomgren

@JohnnyBlomgren 

Glad to see it worked for you. 

 

One of the best things about PowerApps is it's flexibility, seems you are using that feature well. Everyone's needs are different. I often use the OnSuccess to send emails with the LastSubmit data but it is also perfect for your needs as well.

 

All the best 🙂 

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

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (45,871)